Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!samsung!umich!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.programmer Subject: Re: Why use pwd(1) for getpwd(3C)? (Re: Why use find?) Message-ID: <21628:Oct1400:12:2990@kramden.acf.nyu.edu> Date: 14 Oct 90 00:12:29 GMT References: <1990Oct11.012643.11274@diku.dk> <28623:Oct1103:09:1990@kramden.acf.nyu.edu> <4182@auspex.auspex.com> Organization: IR Lines: 19 In article <4182@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: > >> > [ why is getpwd() implemented as `pwd` in System V? ] > >> >Because there's no getwd() system call to have the kernel do the job. > OK, so why *isn't* "getwd()" implemented as `pwd' in BSD? Because the BSD programmers, unlike the AT&T programmers, decided that not being able to figure out your current directory (if you couldn't get to it from root) wasn't a problem at all. > >POSIX has the system call > Bzzt! Sorry, wrong answer, next contestant please. POSIX has *NO* > "system calls", Oh, give it a rest. Everything in the POSIX book is a system call. Sure, some calls might not be implemented inside the kernel---and BSD stat() might not be implemented inside the kernel either. (It can be written in terms of lstat() and readlink(), for example.) ---Dan