source: trunk/minix/man/man2/chroot.2@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 1.6 KB
Line 
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.3 (Berkeley) 8/26/85
6.\"
7.TH CHROOT 2 "August 26, 1985"
8.UC 5
9.SH NAME
10chroot \- change root directory
11.SH SYNOPSIS
12.nf
13.ft B
14#include <unistd.h>
15
16int chroot(const char *\fIdirname\fP)
17.ft R
18.fi
19.SH DESCRIPTION
20.I Dirname
21is the address of the pathname of a directory, terminated by a null byte.
22.B Chroot
23causes this directory
24to become the root directory,
25the starting point for path names beginning with ``/''.
26.PP
27In order for a directory to become the root directory
28a process must have execute (search) access to the directory.
29.PP
30This call is restricted to the super-user.
31.SH "RETURN VALUE
32Upon successful completion, a value of 0 is returned. Otherwise,
33a value of \-1 is returned and \fBerrno\fP is set to indicate an error.
34.SH ERRORS
35.B Chroot
36will fail and the root directory will be unchanged if
37one or more of the following are true:
38.TP 15
39[ENOTDIR]
40A component of the path name is not a directory.
41.TP 15
42[ENAMETOOLONG]
43The path name exceeds PATH_MAX characters.
44.TP 15
45[ENOENT]
46The named directory does not exist.
47.TP 15
48[EACCES]
49Search permission is denied for any component of the path name.
50.TP 15
51[ELOOP]
52Too many symbolic links were encountered in translating the pathname.
53(Minix-vmd)
54.TP 15
55[EFAULT]
56.I Path
57points outside the process's allocated address space.
58.TP 15
59[EIO]
60An I/O error occurred while reading from or writing to the file system.
61.SH "SEE ALSO"
62.BR chdir (2).
Note: See TracBrowser for help on using the repository browser.