Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chdir(2)

chroot(2)

NAME

chroot − change root directory

SYNTAX

chroot(dirname)
char *dirname;

DESCRIPTION

The dirname is the address of the pathname of a directory, terminated by a null byte.  The chroot system call causes this directory to become the root directory, the starting point for path names beginning with “/”.

In order for a directory to become the root directory a process must have execute (search) access to the directory. 

This call is restricted to the super-user. 

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

DIAGNOSTICS

The chroot system call will fail and the root directory will be unchanged if one or more of the following are true:

[ENOTDIR] A component of the path name is not a directory. 

[EINVAL] The pathname contains a character with the high-order bit set. 

[ENAMETOOLONG]
A component of a pathname exceeded 255 characters, or an entire pathname exceeded 1023 characters.

[ENOENT] The named directory does not exist. 

[EACCES] Search permission is denied for any component of the path name. 

[EFAULT] The path points outside the process’s allocated address space. 

[ELOOP] Too many symbolic links were encountered in translating the pathname. 

[EIO] An I/O error occurred while reading from or writing to the file system. 

[ESTALE] The file handle given in the argument is invalid.  The file referred to by that file handle no longer exists or has been revoked. 

[ETIMEDOUT] A "connect" request or remote file operation failed because the connected party did not properly respond after a period of time which is dependent on the communications protocol. 

SEE ALSO

chdir(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026