Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chroot(2) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chdir(2)



chroot(2)                      DG/UX 5.4R3.00                      chroot(2)


NAME
       chroot - change the root directory of the calling process

SYNOPSIS
       #include <unistd.h>

       int  chroot (path)
       char * path;

   where:
       path      Address of a pathname

DESCRIPTION
       Path points to the pathname of a directory.  chroot makes that
       directory the root directory of the calling process, the starting
       point of searches for pathnames beginning with '/'.  If path refers
       to a symbolic link, the target of the symbolic link is made the root
       directory.  The process's working directory is unaffected by the
       chroot system call.

       The '..' entry in the root directory means the root directory itself;
       the root is treated as having no parent directory.  Thus, the process
       cannot access files outside the subtree whose topmost node is the
       root directory, unless the process's current working directory is
       located outside of that subtree.

       If chroot fails, the root directory remains unchanged.

ACCESS CONTROL
       The effective user id of the calling process must be superuser.

RETURN VALUE
       0      The root was successfully changed.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       ENOENT         The named directory does not exist.

       EPERM          Permission to change the root directory is denied.

       ENOENT         The file the pathname resolved to does not exist.

       ENOENT         A non-terminal component of the pathname does not
                      exist.

       ENOTDIR        A non-terminal component of the pathname was not a
                      directory or symbolic link.

       ENAMETOOLONG   The pathname exceeds the length limit for pathnames.

       ENAMETOOLONG   A component of the pathname exceeds the length limit



Licensed material--property of copyright holder(s)                         1




chroot(2)                      DG/UX 5.4R3.00                      chroot(2)


                      for filenames.

       ENOMEM         There are not enough system resources to resolve the
                      pathname or to expand a symbolic link.

       ELOOP          The number of symbolic links encountered during
                      pathname resolution exceeded MAXSYMLINKS.  A symbolic
                      link cycle is suspected.

       EPERM          The pathname contains a character not in the allowed
                      character set.

       EFAULT         The pathname does not completely reside in the
                      process's address space or the pathname does not
                      terminate in the process's address space.

SEE ALSO
       chdir(2).







































Licensed material--property of copyright holder(s)                         2


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