Standard C Library (libc.so, libc.a) System V Compatibility Library (libsys5.a)
Standard C Library:
System V Compatibility Library:
Interfaces documented on this reference page conform to industry standards as follows:
getcwd() - libc version: XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
The getcwd() function returns a pointer to a string containing the absolute pathname of the current directory. The getwd() function is called to obtain the pathname.
[Digital] If the buffer parameter is a null pointer, the getcwd() function, using the malloc() function, obtains the number of bytes of free space as specified by the size parameter. In this case, the pointer returned by the getcwd() function can be used as the parameter in a subsequent call to the free() function.
[Digital] The getcwd() function is supported for multithreaded applications.
Upon successful completion, getcwd() returns the buffer parameter. Otherwise, a null value is returned and errno is set to indicate the error.
The getcwd() function sets errno to the specified values for the following conditions: Read or search permission was denied for a component of the pathname. The size parameter is zero.
Functions: malloc(3), getwd(3)
Standards: standards(5) delim off