Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chroot(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chdir(S)


 chroot(S)                      6 January 1993                      chroot(S)


 Name

    chroot - change root directory

 Syntax


    cc  . . .  -lc


    int chroot (path)
    char *path;


 Description

    The path argument points to a pathname naming a directory.  The chroot
    system call 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.

    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.

    The chroot system call fails and the root directory remains unchanged if
    one or more of the following is true:

    [EFAULT]       The path argument points outside the allocated address
                   space of the process.

    [EINTR]        A signal was caught during the chroot system call.

    [EMULTIHOP]    Components of path require hopping to multiple remote ma-
                   chines.

    [ENOENT]       The named directory does not exist.

    [ENOLINK]      The path argument points to a remote machine and the link
                   to that machine is no longer active.

    [ENOTDIR]      Any component of the pathname is not a directory.

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


 Diagnostics

    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

    chdir(S)

 Standards conformance

    chroot is conformant with:
    AT&T SVID Issue 2;
    and X/Open Portability Guide, Issue 3, 1989.


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