Commit | Line | Data |
---|---|---|
b7793121 KM |
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 | .\" | |
0ca10058 | 5 | .\" @(#)chroot.2 6.1 (Berkeley) %G% |
b7793121 | 6 | .\" |
0ca10058 | 7 | .TH CHROOT 2 "" |
b7793121 KM |
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 | This call is restricted to the super-user. | |
30 | .SH "RETURN VALUE | |
31 | Upon successful completion, a value of 0 is returned. Otherwise, | |
32 | a value of \-1 is returned and \fIerrno\fP is set to indicate an error. | |
33 | .SH ERRORS | |
34 | .I Chroot | |
35 | will fail and the root directory will be unchanged if | |
36 | one or more of the following are true: | |
37 | .TP 15 | |
38 | [ENOTDIR] | |
39 | A component of the path name is not a directory. | |
40 | .TP 15 | |
41 | [ENOENT] | |
42 | The pathname was too long. | |
43 | .TP 15 | |
44 | [EPERM] | |
45 | The argument contains a byte with the high-order bit set. | |
46 | .TP 15 | |
47 | [ENOENT] | |
48 | The named directory does not exist. | |
49 | .TP 15 | |
50 | [EACCES] | |
51 | Search permission is denied for any component of | |
52 | the path name. | |
53 | .TP 15 | |
54 | [EFAULT] | |
55 | .I Path | |
56 | points outside the process's allocated address space. | |
57 | .TP 15 | |
58 | [ELOOP] | |
59 | Too many symbolic links were encountered in translating | |
60 | the pathname. | |
61 | .SH "SEE ALSO" | |
62 | chdir(2) |