BSD 4_3_Tahoe development
[unix-history] / usr / man / cat2 / chdir.0
CHDIR(2) UNIX Programmer's Manual CHDIR(2)
N\bNA\bAM\bME\bE
chdir - change current working directory
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
c\bch\bhd\bdi\bir\br(\b(p\bpa\bat\bth\bh)\b)
c\bch\bha\bar\br *\b*p\bpa\bat\bth\bh;\b;
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bP_\ba_\bt_\bh is the pathname of a directory. _\bC_\bh_\bd_\bi_\br causes this
directory to become the current working directory, the
starting point for path names not beginning with ``/''.
In order for a directory to become the current directory, a
process must have execute (search) access to the directory.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bE
Upon successful completion, a value of 0 is returned. Oth-
erwise, a value of -1 is returned and _\be_\br_\br_\bn_\bo is set to indi-
cate the error.
E\bER\bRR\bRO\bOR\bRS\bS
_\bC_\bh_\bd_\bi_\br will fail and the current working directory will be
unchanged if one or more of the following are true:
[ENOTDIR] A component of the path prefix is not a
directory.
[EINVAL] The pathname contains a character with the
high-order bit set.
[ENAMETOOLONG] A component of a pathname exceeded 255 char-
acters, or an entire path name exceeded 1023
characters.
[ENOENT] The named directory does not exist.
[ELOOP] Too many symbolic links were encountered in
translating the pathname.
[EACCES] Search permission is denied for any component
of the path name.
[EFAULT] _\bP_\ba_\bt_\bh points outside the process's allocated
address space.
[EIO] An I/O error occurred while reading from or
writing to the file system.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
chroot(2)
Printed 7/9/88 August 26, 1985 1