[456] in bugtraq
Re: 8lgm's SCO "at" hole
daemon@ATHENA.MIT.EDU (Casper Dik)
Sat Dec 10 09:32:46 1994
To: Karl Strickland <karl@bagpuss.demon.co.uk>
Cc: bugtraq@fc.net
In-Reply-To: Your message of "Fri, 09 Dec 1994 21:05:14 GMT."
<199412092105.VAA18089@bagpuss.demon.co.uk>
Date: Sat, 10 Dec 1994 14:22:16 +0100
From: Casper Dik <casper@fwi.uva.nl>
>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).
Neither of the calls is a system call on any system that I'm aware of.
Getcwd(3) is the thing POSIX wants you to use.
Getwd() is to getcwd() what gets() is to fgets() [ well, almost ].
When chosing between: getwd(char *buf) and getcwd(char *buf, size_t size_of_buf)
the choice should be obvious.
In SunOS 4.1.x, getcwd() does call /bin/pwd.
In Solaris 2.x, getcwd() use /etc/mnttab and some tree traversal
to find the current directory. getwd is relegated to libucb.so and
just calls getcwd(buf, MAXPATHLEN);
Casper