#include <unistd.h> int chdir(const char *path);
int fchdir(int fildes);
The chdir() and fchdir() functions cause a directory pointed to by path or fildes to become the current working directory. The starting point for path searches for path names not beginning with / (slash). The path argument points to the path name of a directory. The fildes argument is an open file descriptor of a directory.
For a directory to become the current directory, a process must have execute (search) access to the directory.
Upon successful completion, 0 is returned. Otherwise, −1 is returned, the current working directory is unchanged, and errno is set to indicate the error.
The chdir() function will fail if:
The fchdir() function will fail if:
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
|December 28, 1996||OmniOS|