Unified getcwd() implementation

Tim Robbins tjr at freebsd.org
Fri May 7 20:03:57 PDT 2004


On Sat, May 08, 2004 at 02:23:57AM +0100, Bruce M Simpson wrote:
> On Sat, May 08, 2004 at 11:02:28AM +1000, Tim Robbins wrote:
> > It's not inherently Linux-specific, but it exists solely for the benefit
> > of Linux emulation. I don't see why they need to be merged at the
> > expense of complicating the native system calls -- we have way
> > too many tentacles of the Linux emulator reaching in there already.
> 
> Sorry, what you are saying here doesn't seem to make sense to me.
> The implementation of getcwd() in the Linux emulator is a full getcwd()
> implementation.

I did not claim otherwise.

> The whole point of reverting to directory scanning rather than using the
> namecache is to address the problems caused when path components can't be
> found in the namecache; this is the ethos of the patch, which eliminates
> the duplicated functionality in the Linuxulator at the same time.

When path components are not found in the namecache, getcwd() (in libc)
will find the directory the old-fashioned way by walking ".." links.

> I don't understand how this 'complicates native system calls' when it's
> intended to address several PRs which exist with regards to our current
> implementation of getcwd() in FreeBSD, unless there is something I'm missing?

I don't see how it differs from what we already do in userland.


Tim


More information about the freebsd-current mailing list