Why use pwd(1) for getpwd(3C)? (Re: Why use find?)

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Sun Oct 14 10:12:29 AEST 1990


In article <4182 at auspex.auspex.com> guy at 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



More information about the Comp.unix.programmer mailing list