Retrieves the working directory's pathname.
#include <unistd.h> char * getcwd (char *buf, size_t size); char * _th_getcwd (char *buf, size_t size);
getcwd copies the absolute pathname of the current working directory into the memory referenced by buf and returns a pointer to buf
. The size
argument is the size, in bytes, of the array referenced by buf
.
If buf
is NULL, space is allocated as necessary to store the pathname. This space may later be free(3)'d.
_th_getcwd returns the current path for a thread. Getcwd() returns the current path for a process.
EINVAL |
The value of buffer is 0 (zero). |
EACESS |
Read or search permission was denied for a component of the pathname. |
EINVAL |
The size argument is zero. |
ENOENT |
A component of the pathname no longer exists. |
ENOMEM |
Insufficient memory is available. |
ERANGE |
The size argument is greater than zero but smaller than the length of the pathname plus 1. |
buf
. Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.13 | intime/rt/include/direct.h | rt.h | clib.lib |