Article View: comp.unix.programmer
Article #1026Re: Why use pwd(1) for getpwd(3C)? (Re: Why use find?)
From: Wm E. Davidsen Jr
Date: Sat, 13 Oct 1990 19:26
Date: Sat, 13 Oct 1990 19:26
21 lines
1717 bytes
1717 bytes
In article <23012:Oct1019:12:2790@kramden.acf.nyu.edu> brnstnd@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@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
Technical Details
Message-ID:
<2057@sixhub.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!sixhub!davidsenReferences:
<1977@sixhub.UUCP> <1990Oct7.001518.14216@diku.dk> <1990Oct9.122813.1329@cbnews.att.com> <23012:Oct1019:12:2790@kramden.acf.nyu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.programmer Subject: Re: Why use pwd(1) for getpwd(3C)? (Re: Why use find?) Message-ID: <2057@sixhub.UUCP> Date: 13 Oct 90 19:26:37 GMT References: <1977@sixhub.UUCP> <1990Oct7.001518.14216@diku.dk> <1990Oct9.122813.1329@cbnews.att.com> <23012:Oct1019:12:2790@kramden.acf.nyu.edu> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 21