Manual Section... (3) - page: getwd NAMEgetcwd, getwd,
get_current_dir_name - Get current working directory #include
<unistd.h> char *getcwd(char *buf, size_t size); char
*getwd(char *buf); char *get_current_dir_name(void); Feature
Test Macro Requirements for glibc (see feature_test_macros(7)):
DESCRIPTIONThese functions return a null-terminated string
containing an absolute pathname that is the current working
directory of the calling process. The pathname is returned as
the function result and via the argument buf, if present. The
getcwd() function copies an absolute pathname of the current
working directory to the array pointed to by buf, which is of
length size. If the length of the absolute pathname of the
current working directory, including the terminating null byte,
exceeds size bytes, NULL is returned, and errno is set to
ERANGE; an application should check for this error, and allocate
a larger buffer if necessary. As an extension to the
POSIX.1-2001 standard, Linux (libc4, libc5, glibc) getcwd() all