From owner-freebsd-emulation Mon Mar 11 11:26:22 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from ophelia.dogcow.org (ophelia.dogcow.org [216.162.195.122]) by hub.freebsd.org (Postfix) with ESMTP id DBE8137B400 for ; Mon, 11 Mar 2002 11:26:16 -0800 (PST) Received: from desdemona.sharding.net (localhost [127.0.0.1]) by ophelia.dogcow.org (8.12.2/8.12.2) with ESMTP id g2BJS42t014245 for ; Mon, 11 Mar 2002 11:28:04 -0800 (PST) Received: (from sharding@localhost) by desdemona.sharding.net (8.12.2/8.12.2/Submit) id g2BJS4Lf014244 for freebsd-emulation@freebsd.org; Mon, 11 Mar 2002 11:28:04 -0800 (PST) Date: Mon, 11 Mar 2002 11:28:04 -0800 From: Sean Harding To: freebsd-emulation@freebsd.org Subject: Possible bug with mkdir() in linux emulation? Message-ID: <20020311192804.GE7788@dogcow.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I've recently run into a problem in running Mozilla Linux binaries on my FreeBSD system. This problem is documented in Mozilla bugs 125489 and 126113 (http://bugzilla.mozilla.org/show_bug.cgi?id=125489 and http://bugzilla.mozilla.org/show_bug.cgi?id=126113). What this seems to boil down to is that in Linux binaries on FreeBSD, mkdir() on an existing directory to whose parent I don't have write permission, errno is set to EACCES (13) instead of EEXIST (17). When the same binary is run on a real Linux system, errno is set to EEXIST. And when the same code is compiled natively on FreeBSD, it does the same. My sample code: int main(){ int result; result = mkdir("/home",(mode_t)0755); printf("Result is %d, errno is %d.\n",result,errno); return 0; } The output from a Linux binary on Linux: Result is -1, errno is 17. The output from the same binary on FreeBSD (4.5-STABLE and 4.5-RELEASE): Result is -1, errno is 13. The output from the code compiled natively on FreeBSD and run on the same machine: Result is -1, errno is 17. This doesn't seem right. Could someone shed some light on why this is happening? Thanks. sean -- Sean Harding sharding@dogcow.org | "I didn't sell out, I bought in. http://www.dogcow.org/sean/ | Remember that." | --Father, 'SLC Punk' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message