GETCWD(3)

NAME
getcwd - get current working directory pathname

SYNOPSIS
#include <unistd.h>
char *getcwd(char *pathname, size_t len)

DESCRIPTION
Getcwd copies the absolute pathname of the current working directory to pathname and returns a pointer to the result. Pathname is a character array of length len.

DIAGNOSTICS
Getcwd returns a null pointer and sets errno if an error occurs. The error will reflect the system call errors that may occur if the path to the current directory is searched upwards to the root directory. The error ERANGE is returned if the result does not fit within len bytes.