Jim Meyering <[EMAIL PROTECTED]> 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


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to