FCHDIR(3) Library Functions Manual FCHDIR(3)
NAME
fchdir — change
working directory
SYNOPSIS
#include <unistd.h> int fchdir(int fildes);
DESCRIPTION
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 .
RETURN VALUE
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.
ERRORS
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:
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
chdir(3) , <unistd.h> .
February 1997 posix.fail