fchdir - change working directory
#include <unistd.h> int fchdir(int fildes);
The fchdir() function has the same effect as chdir() except that the directory that is to be the new current working directory is specified by the file descriptor fildes.
Upon successful completion, fchdir() returns 0. Otherwise, it returns -1 and sets errno to indicate the error. On failure the current working directory remains unchanged.
The fchdir() function will fail if:
- [EACCES]
- Search permission is denied for the directory referenced by fildes.
- [EBADF]
- The fildes argument is not an open file descriptor.
- [ENOTDIR]
- The open file descriptor fildes does not refer to a directory.
The fchdir() may fail if:
- [EINTR]
- A signal was caught during the execution of fchdir().
- [EIO]
- An I/O error occurred while reading from or writing to the file system.
None.
None.
None.
chdir(), <unistd.h>.