chroot(2)                                                         chroot(2)
                               TO BE OBSOLETED
 NAME    [Toc]    [Back]
      chroot - change root directory
 SYNOPSIS    [Toc]    [Back]
      #include <unistd.h>
      int chroot(const char *path);
 DESCRIPTION    [Toc]    [Back]
      chroot() causes the named directory to become the root directory, the
      starting point for path searches for path names beginning with /.
      path points to a path name naming a directory.  The user's working
      directory is unaffected by the chroot() system call.
      The effective user ID of the process must be a user having appropriate
      privileges 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    [Toc]    [Back]
      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    [Toc]    [Back]
      chroot() fails and the root directory remains unchanged if one or more
      of the following is 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 a user who
                                    has appropriate privileges.
           [EFAULT]                 path points outside the allocated
                                    address space of the process.  The
                                    reliable detection of this error is
                                    implementation dependent.
           [ENAMETOOLONG]           The length of the specified path name
                                    exceeds PATH_MAX bytes, or the length of
                                    a component of the path name exceeds
                                    NAME_MAX bytes while _POSIX_NO_TRUNC is
                                    in effect.
           [ELOOP]                  Too many symbolic links were encountered
                                    in translating the path name.
 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003
 chroot(2)                                                         chroot(2)
                               TO BE OBSOLETED
 WARNINGS    [Toc]    [Back]
    Obsolescent Interfaces
      chroot() is to be obsoleted at a future date.
 SEE ALSO    [Toc]    [Back]
      chroot(1M), chdir(2).
 STANDARDS CONFORMANCE    [Toc]    [Back]
      chroot(): AES, SVID2, SVID3, XPG2, XPG3, XPG4
 Hewlett-Packard Company            - 2 -   HP-UX 11i Version 2: August 2003 [ Back ] |