GETWD(3) Library Functions Manual GETWD(3)

getwdget the current working directory pathname

#include <unistd.h>

char *getwd(char *path_name);

The getwd() function determines an absolute pathname of the current working directory of the calling process, and copies that pathname into the array pointed to by the path_name argument.

If the length of the pathname of the current working directory is greater than ({PATH_MAX} + 1) including the null byte, fails and returns a null pointer.

Upon successful completion, a pointer to the string containing the absolute pathname of the current working directory is returned. Otherwise, getwd() returns a null pointer and the contents of the array pointed to by path_name are undefined.

No errors are defined.

None.

For portability to implementations conforming to earlier versions of this specification, getcwd(3) is preferred over this function.

None.

getcwd(3) , <unistd.h> .

February 1997 posix.fail