chroot(2) chroot(2)NAME chroot - changes the root directory SYNOPSIS int chroot(path) char *path; DESCRIPTION chroot causes the named directory to become the root directory, the starting point for path searches for pathnames beginning with /. The user's working directory is unaffected by the chroot system call. path points to a pathname naming a directory. The effective user ID of the process must be the superuser to change the root directory. The .. entry in the root directory is interpreted to mean the root directory itself. Thus, .. cannot be used to access files outside the subtree rooted at the root directory. STATUS MESSAGES AND VALUES Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. The chroot command will fail and the root directory will remain unchanged if one or more of the following is true: ENOTDIR Any component of the pathname is not a directory. ENAMETOOLONG A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX. ELOOP Too many symbolic links were encountered in translating a pathname. ENOENT The named directory does not exist. EPERM A pathname contains a character with the high-order bit set. EPERM The effective user ID is not the superuser. EFAULT January 1992 1
chroot(2) chroot(2)path points outside the allocated address space of the process. SEE ALSO chdir(2) chroot(1M) in A/UX System Administrator's Reference 2 January 1992