chdir(2) chdir(2)NAME chdir - change working directory SYNOPSIS int chdir(path) char *path; DESCRIPTION chdir causes the named directory to become the current work- ing directory, the starting point for path searches for path names not beginning with /. path points to the path name of a directory. RETURN VALUE Upon successful completion, a value of 0 is returned. Oth- erwise, a value of -1 is returned and errno is set to indi- cate the error. ERRORS chdir will fail and the current working directory will be unchanged if one or more of the following are true: [EPERM] A pathname contains a character with the high-order bit set. [ENAMETOOLONG] A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX. [ELOOP] Too many symbolic links were encountered in translating a pathname. [ENOTDIR] A component of the path name is not a directo- ry. [ENOENT] The named directory does not exist. [EACCES] Search permission is denied for any component of the path name. [EFAULT] path points outside the allocated address space of the process. SEE ALSO csh(1), ksh(1), sh(1), chroot(2). April, 1990 1