Returns the current working directory of the current thread group
#include <unistd.h>
char *getcwd (
char *buffer,
size_t size);
(OUT) Specifies the buffer in which to place the current working directory.
(IN) Specifies the length of buffer (including space for the delimiting \0 character).
Returns the address of the string containing the name of the current working directory if successful. Otherwise, NULL is returned and errno is set.
When the buffer parameter is NULL, a string is allocated to contain the current working directory. This string must be freed (by calling the free function) or NetWare will issue a leaked memeory error at unload time.
Blocking Information Locally, getcwd blocks when the buffer parameter is NULL and does not block when the buffer parameter is not NULL.