Changes the current working directory to the specified directory.
#include <unistd.h> int fchdir ( int fildes);
(IN) Specifies a file descriptor that references a directory. If it references a file, fchdir sets errno to ENOTDIR.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following. On failure, the current working directory remains unchanged.
The fchdir function causes the directory named by the fildes parameter to become the current working directory for all threads of a virtual machine. It becomes the starting point for path searches for pathnames not beginning with “/”.