Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
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 define. 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 undefined.
• The error values [EACCES] and [ENOMEM] can be returned.
The following are HP extensions to the XPG4 Version 2 specification:
• The error values [ECWDTOOLONG], [EFAULT], [EFSBAD], [ENOCRE],
[ENOROOT], [ENXIO], and [EOSSNOTRUNNING] can be returned.
527187-007 Hewlett-Packard Company 3−21