Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chroot(2) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chroot(1M)

chdir(2)

CHROOT(2)  —  HP-UX

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 user’s working directory is unaffected by the chroot system call. 

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, ..  cannot be used to access files outside the subtree rooted at the root directory. 

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. 

ERRORS

Chroot will fail and the root directory will remain unchanged if one or more of the following are true:

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

­[ENOENT] The named directory does not exist or a component of the path does not exist. 

­[EPERM] The effective user ID is not super-user. 

­[EFAULT] Path points outside the allocated address space of the process.  The reliable detection of this error will be implementation dependent. 

­[ENAMETOOLONG] The named directory exceeds MAXPATHLEN characters. 

­[ELOOP] Too many symbolic links were encountered in translating the path name. 

SEE ALSO

chroot(1M), chdir(2). 

Hewlett-Packard Company  —  May 11, 2021

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