replacement getwd(3).

Casper H.S. Dik casper at fwi.uva.nl
Thu Nov 8 09:12:50 AEST 1990


eric at mks.com (Eric Gisin) writes:

    Ideally none would break, because any properly written program
    on SysV or SunOS would use getcwd(), not getwd().
    Any program that effectively does chdir(getwd()) would break
    with your getwd. ~ expansion is handled by applications,
    not libc and the kernel.

What I meant was that I use the pw_dir field from the password file.
In my private copy of the shared library this seems to work well.

Now what about those programs using getcwd()? 
Well, getcwd() calls popen() with the command pwd. Pwd would use my
getwd() except that pwd is a shell builtin and the shell is statically
linked. (This must indicate that sh(1) uses getwd and not getcwd,
for an infinite loop would result).

--
Casper H.S. Dik, casper at fwi.uva.nl,	NIC: !cd151



More information about the Comp.unix.internals mailing list