1CHROOT(2)                     System Calls Manual                    CHROOT(2)
2
3
4

NAME

6       chroot - change root directory
7

SYNOPSIS

9       chroot(dirname)
10       char *dirname;
11

DESCRIPTION

13       Dirname  is the address of the pathname of a directory, terminated by a
14       null byte.  Chroot causes this directory to become the root  directory,
15       the starting point for path names beginning with ``/''.
16
17       In  order  for  a directory to become the root directory a process must
18       have execute (search) access to the directory.
19
20       This call is restricted to the super-user.
21

RETURN VALUE

23       Upon successful completion, a value of 0  is  returned.   Otherwise,  a
24       value of -1 is returned and errno is set to indicate an error.
25

ERRORS

27       Chroot  will  fail  and  the root directory will be unchanged if one or
28       more of the following are true:
29
30       [ENOTDIR]      A component of the path name is not a directory.
31
32       [EINVAL]       The pathname contains a character  with  the  high-order
33                      bit set.
34
35       [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
36                      entire path name exceeded 1023 characters.
37
38       [ENOENT]       The named directory does not exist.
39
40       [EACCES]       Search permission is denied for  any  component  of  the
41                      path name.
42
43       [ELOOP]        Too  many symbolic links were encountered in translating
44                      the pathname.
45
46       [EFAULT]       Path points  outside  the  process's  allocated  address
47                      space.
48
49       [EIO]          An  I/O  error occurred while reading from or writing to
50                      the file system.
51

SEE ALSO

53       chdir(2)
54
55
56
574.2 Berkeley Distribution       August 26, 1985                      CHROOT(2)
Impressum