Path: utzoo!attcan!uunet!decwrl!wuarchive!zaphod.mps.ohio-state.edu!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.unix.programmer Subject: Re: Why use pwd(1) for getpwd(3C)? (Re: Why use find?) Keywords: getpwd(3) pwd(1) "." ".." Message-ID: <1990Oct11.155803.5421@smsc.sony.com> Date: 11 Oct 90 15:58:03 GMT References: <1990Oct11.012643.11274@diku.dk> <28623:Oct1103:09:1990@kramden.acf.nyu.edu> <1990Oct11.044435.3729@csusac.csus.edu> Organization: Sony Microsystems Corp, San Jose, CA Lines: 16 In article <1990Oct11.044435.3729@csusac.csus.edu> jetfuel@csusac.UUCP (Dave Jenks) writes: >Actually, pwd(1) has no better chance of being able to figure out the >current directory than getpwd(3) could, since pwd follows the >directory from "." to "/" using each directory's ".." entry. This discussion has gotten very off-track. Dave, you must realize that not all systems are the same. There are systems on which pwd(1) is setuid root, just as there are systems without a mkdir(2) system call that have a setuid mkdir(1) command. These aren't BSD, and they may be considered archaic, but they do exist. The fact now is that SVR4, which is supposed to be POSIX-conformant, does not have a setuid version of pwd, and its version of getcwd(3C) works just like the BSD getwd(3) routine.