CHROOT(2) — Silicon Graphics
NAME
chroot − change root directory
SYNOPSIS
int chroot (path)
char ∗path;
DESCRIPTION
Path points to a path name naming a directory. Chroot causes the named directory to become the root directory, the starting point for path searches for path names beginning with /.
The effective user ID of the process must be super-user to change the root directory.
The .. entry in the root directory is interpreted to mean the root directory itself. Thus, .. can not be used to access files outside the subtree rooted at the root directory.
Chroot will fail and the root directory will remain unchanged if one or more of the following are true:
Any component of the path name is not a directory. [ENOTDIR]
The named directory does not exist. [ENOENT]
The effective user ID is not super-user. [EPERM]
Path points outside the process’s allocated address space. [EFAULT]
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.
SEE ALSO
ASSEMBLER
moveq#61,D0
movlpath,A0
trap#0
Carry bit set on failure and cleared on success.
Version 2.5 — April 22, 1987