FCHDIR(3) Library Functions Manual FCHDIR(3)

fchdirchange working directory

#include <unistd.h>

int fchdir(int fildes);

The fchdir() function has the same effect as chdir(3) 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:

Search permission is denied for the directory referenced by fildes .
The fildes argument is not an open file descriptor.
The open file descriptor fildes does not refer to a directory.

The may fail if:

A signal was caught during the execution of fchdir() .
An I/O error occurred while reading from or writing to the file system.

None.

None.

None.

chdir(3) , <unistd.h> .

February 1997 posix.fail