Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

OSS Library Calls (g - h) getcwd(3)
[ERANGE] The size parameter is greater than 0 (zero) but smaller than the length of the
pathname + 1.
RELATED INFORMATION
Functions: chdir(2), malloc(3).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to dene. The following
features are affected in the HP implementation:
If the buffer parameter is a null pointer, the getcwd() function uses the malloc() function
to allocate a buffer. In that case, the caller should subsequently release the buffer by
using the pointer returned by getcwd() as a parameter in a call to the free() function.
If an error is detected, the content of the array pointed to by buffer is undened.
The error values [EACCES] and [ENOMEM] can be returned.
The following are HP extensions to the XPG4 Version 2 specication:
The error values [ECWDTOOLONG], [EFAULT], [EFSBAD], [ENOCRE],
[ENOROOT], [ENXIO], and [EOSSNOTRUNNING] can be returned.
527187-004 Hewlett-Packard Company 321