Syntax | #include <unistd.h> char *getcwd(char *buf, int size); | |
Description |
If buf is not null, the pathname will be stored in the space pointed to by buf. If buf is a null pointer, The current directory will correspond to the home directory so long as no call to When a C program is started, the current directory is set to the home directory, as defined If the directory entered in the file BS2000 The current directory can be changed at any time by calling | |
Return val. | pointer to the current directory pathname | |
if successful. | ||
0 | if size is not large enough or an error occurs in a subordinate function. | |
Errors |
| |
|
| The name of a parent directory could not be obtained because the directory could not be read. |
|
| size is equal to 0. |
|
| Insufficient storage space is available. |
|
| size is less than 0, or is greater than 0, but smaller than the length of the pathname + 1. |
Notes |
| |
See also |
|