[454] in bugtraq

home help back first fref pref prev next nref lref last post

Re: 8lgm's SCO "at" hole

daemon@ATHENA.MIT.EDU (Steinar Haug)
Sat Dec 10 03:53:23 1994

Date: Sat, 10 Dec 1994 08:30:48 +0100 (MET)
From: Steinar Haug <Steinar.Haug@runit.sintef.no>
To: Karl Strickland <karl@bagpuss.demon.co.uk>
Cc: Justin Mason <jmason@iona.ie>, bugtraq@fc.net
In-Reply-To: <199412092105.VAA18089@bagpuss.demon.co.uk>

> AFAIK, getcwd(3) always calls /bin/pwd; but getwd(2) is a system call.
> getcwd() is only provided for backwards compatibility; i suppose all new
> code should be using getwd(2).

In SunOS 4.1.3 (and 4.1.2) they are both library functions. getcwd() uses
popen, as noted. getwd() traverses the path upwards by repeatedly opening 
the directory on the level above and reading directory entries until it 
gets a match for the current directory. It uses /etc/mtab to avoid hanging
across mount points that might be dead.

In HP-UX 9.05 getcwd() traverses the path upwards - it does *not* use 
popen(). getwd() doesn't exist.

POSIX wants you to use getcwd().

Steinar Haug, SINTEF RUNIT, University of Trondheim, NORWAY
Email: Steinar.Haug@runit.sintef.no

home help back first fref pref prev next nref lref last post