Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!fwi.uva.nl!casper From: casper@fwi.uva.nl (Casper H.S. Dik) Newsgroups: comp.unix.internals Subject: Re: replacement getwd(3). Message-ID: <1432@carol.fwi.uva.nl> Date: 7 Nov 90 22:12:50 GMT References: <1431@carol.fwi.uva.nl> Sender: news@fwi.uva.nl Lines: 19 eric@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@fwi.uva.nl, NIC: !cd151