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.
5 .\" @(#)chroot.2 6.3 (Berkeley) 8/26/85
7 .TH CHROOT 2 "August 26, 1985"
10 chroot \- change root directory
16 int chroot(const char *\fIdirname\fP)
21 is the address of the pathname of a directory, terminated by a null byte.
24 to become the root directory,
25 the starting point for path names beginning with ``/''.
27 In order for a directory to become the root directory
28 a process must have execute (search) access to the directory.
30 This call is restricted to the super-user.
32 Upon successful completion, a value of 0 is returned. Otherwise,
33 a value of \-1 is returned and \fBerrno\fP is set to indicate an error.
36 will fail and the root directory will be unchanged if
37 one or more of the following are true:
40 A component of the path name is not a directory.
43 The path name exceeds PATH_MAX characters.
46 The named directory does not exist.
49 Search permission is denied for any component of the path name.
52 Too many symbolic links were encountered in translating the pathname.
57 points outside the process's allocated address space.
60 An I/O error occurred while reading from or writing to the file system.