|
|
1.1 root 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.
4: .\"
5: .\" @(#)chdir.2 6.3 (Berkeley) 8/26/85
6: .\"
7: .TH CHDIR 2 "August 26, 1985"
8: .UC 4
9: .SH NAME
10: chdir \- change current working directory
11: .SH SYNOPSIS
12: .nf
13: .ft B
14: chdir(path)
15: char *path;
16: .ft R
17: .fi
18: .SH DESCRIPTION
19: .I Path
20: is the pathname of a directory.
21: .I Chdir
22: causes this directory
23: to become the current working directory,
24: the starting point for path names not beginning with ``/''.
25: .PP
26: In order for a directory to become the current directory,
27: a process must have execute (search) access to the directory.
28: .SH "RETURN VALUE
29: Upon successful completion, a value of 0 is returned.
30: Otherwise, a value of \-1 is returned and \fIerrno\fP is set to indicate
31: the error.
32: .SH ERRORS
33: .I Chdir
34: will fail and the current working directory will be unchanged if
35: one or more of the following are true:
36: .TP 15
37: [ENOTDIR]
38: A component of the path prefix is not a directory.
39: .TP 15
40: [EINVAL]
41: The pathname contains a character with the high-order bit set.
42: .TP 15
43: [ENAMETOOLONG]
44: A component of a pathname exceeded 255 characters,
45: or an entire path name exceeded 1023 characters.
46: .TP 15
47: [ENOENT]
48: The named directory does not exist.
49: .TP 15
50: [ELOOP]
51: Too many symbolic links were encountered in translating the pathname.
52: .TP 15
53: [EACCES]
54: Search permission is denied for any component of
55: the path name.
56: .TP 15
57: [EFAULT]
58: .I Path
59: points outside the process's allocated address space.
60: .TP 15
61: [EIO]
62: An I/O error occurred while reading from or writing to the file system.
63: .SH "SEE ALSO"
64: chroot(2)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.