Returns a pointer to the file specification for the current working directory.
#include <unistd.h>
char *getcwd (char *buffer, size_t size); (ISO POSIX-1)
char *getcwd (char *buffer, unsigned int
size, . . . ); (DEC C Extension)
Function Variants
This function also has variants named _getcwd32 and _getcwd64 for
use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using
pointer-size-specific functions.
If buffer is a NULL pointer, getcwd obtains size bytes of space using malloc. In this case, you can use the pointer returned by getcwd as the argument in a subsequent call to free.
| x | A pointer to the file specification. |
| NULL | Indicates an error. |