1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)chdir.2 6.3 (Berkeley) 8/26/85
7 .TH CHDIR 2 "August 26, 1985"
10 chdir, fchdir \- change current working directory
16 int chdir(const char *\fIpath\fP)
17 int fchdir(int \fIfd\fP)
22 is the pathname of a directory.
24 is the file descriptor of a directory.
28 to become the current working directory,
29 the starting point for path names not beginning with ``/''.
31 In order for a directory to become the current directory,
32 a process must have execute (search) access to the directory.
34 Upon successful completion, a value of 0 is returned.
35 Otherwise, a value of \-1 is returned and \fBerrno\fP is set to indicate
39 will fail and the current working directory will be unchanged if
40 one or more of the following are true:
43 A component of the path prefix is not a directory.
46 The path name exceeds PATH_MAX characters.
49 The named directory does not exist.
52 Too many symbolic links were encountered in translating the pathname.
56 Search permission is denied for any component of
61 points outside the process's allocated address space.
64 An I/O error occurred while reading from or writing to the file system.