The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

fchdir - change working directory

 SYNOPSIS



#include <unistd.h>

int fchdir(int fildes);

 DESCRIPTION

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.

 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:

[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.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

chdir(), <unistd.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]