Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2002 10:19:20 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Sean Harding <sharding@dogcow.org>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: Possible bug with mkdir() in linux emulation?
Message-ID:  <15503.28152.181832.704801@grasshopper.cs.duke.edu>
In-Reply-To: <20020311192804.GE7788@dogcow.org>
References:  <20020311192804.GE7788@dogcow.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Sean Harding writes:
 > 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. 


Here's what's actually happening (from ktrace/linux_kdump):

 31680 mkdir.linux NAMI  "/compat/linux"
 31680 mkdir.linux NAMI  "/compat/linux/home"
 31680 mkdir.linux RET   getppid -1 errno -13 Unknown error: -13

The key is that the linux abi prepends the default location of the
linux environment to all filename accesses.  This is primarily done so
as to be able to find linux shared libs & config files.  So your
program is trying to make /compat/linux/home, which doesn't exist &
which you do not have permission to create.

Cheers,

Drew



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15503.28152.181832.704801>