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

Wm E. Davidsen Jr davidsen at sixhub.UUCP
Sun Oct 14 05:26:37 AEST 1990


In article <23012:Oct1019:12:2790 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:

| Because there's no getwd() system call to have the kernel do the job.
| Unless you have some sort of privileges, you won't be able to figure
| out the current directory when any higher directory is unreadable.

  There were earlier version of UNIX which lackled the call (it's
getcwd, by the way), but it's in recent versions of SysV, Xenix, etc.
And there was never a reason to do more than one, and /bin/pwd is a
program which could be run directly, father than by forking a shell as
noted in the original posting, etc.

  In other words there's no reason for a problem, it's just a bad
implementation one that system. Also, until I looked at the accounting
file, I find it hard to believe that the fork happens more than once on
any system. I don't say it doesn't, just that I want to see it.
-- 
bill davidsen - davidsen at sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.unix.programmer mailing list