#include <unistd.h> int getcwd( void );
The getcwd()
function copies the absolute pathname of the current
working directory to the character array pointed to by buf
. The
size
argument is the number of bytes available in buf
There is no way to determine the maximum string length that fetcwd()
may need to return. Applications should tolerate getting ERANGE
and allocate a larger buffer.
It is possible for getcwd()
to return EACCES if, say, login
puts the process into a directory without read access.
The 1988 standard uses int
instead of size_t
for the second
parameter.
Copyright © 1988-2000 OAR Corporation