Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: he...@utzoo.UUCP (Henry Spencer) Newsgroups: net.sources Subject: public-domain getwd(3) Message-ID: <4027@utzoo.UUCP> Date: Wed, 4-Jul-84 17:21:24 EDT Article-I.D.: utzoo.4027 Posted: Wed Jul 4 17:21:24 1984 Date-Received: Wed, 4-Jul-84 17:21:24 EDT Organization: U of Toronto Zoology Lines: 231 The following is the source and manual page for a public-domain getwd(3) routine, the C function equivalent of the pwd(1) program. This stuff has been written from scratch without reference to Bell or Berkeley sources. It may be used by anyone, on any system, for any purpose. It has been tested on both V7 and 4.1BSD, and is believed to contain no gratuitous system dependencies, with one exception: it wants the Berkeley routines for directory scanning. It could easily be fixed to bypass this need, but since I think the directory routines are a Good Thing and their use should be encouraged, I haven't done so. Note that the reference in the manual page to pwd(1) running setuid-root may not be true everywhere (although it should be made true everywhere...). ----- Code ----- -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry