Jim Meyering <address@hidden> writes:
> It's probably best to avoid using getcwd altogether.
One partial workaround for "pwd" is to add support for the -L and -P
options to "pwd" that are required by POSIX 1003.1-2001. Since -L is
the default, getcwd won't be invoked at all in the normal case.
The basic idea is that pwd normally will invoke stat (getenv ("PWD"))
and make sure that it returns the same device and inode that stat
(".") does; if so, it merely prints $PWD. (There are special cases
if $PWD contains "." or ".." path name components.)
http://www.opengroup.org/onlinepubs/007904975/utilities/pwd.html
[Prev in Thread]
Current Thread
[Next in Thread]
Re: pwd vs. extremely long pathnames,
Paul Eggert<=