GETWD(3) GETWD(3) NAME getwd, getcwd - get current directory SYNOPSIS char *getwd(buf) char *buf; char *getcwd(buf, size) char *buf; DESCRIPTION Both routines fill buf with a null-terminated string repre- senting the current directory and return buf. A null pointer is returned on an error and buf is filled with a diagnostic. Getwd is in the style of 4.2 BSD and getcwd in that of Sys- tem V. If buf is null, this entry will call malloc(3) to allocate size bytes for the buffer. SEE ALSO pwd(1)