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