*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> chroot (2)              
Title
Content
Arch
Section
 

chroot(2)

Contents


NAME    [Toc]    [Back]

       chroot - Change the effective root directory

SYNOPSIS    [Toc]    [Back]

       #include <unistd.h>

       int chroot(
               const char *path );

STANDARDS    [Toc]    [Back]

       Interfaces  documented  on  this reference page conform to
       industry standards as follows:

       chroot(): XSH4.0, XSH4.2, XSH5.0

       The chroot() function is marked as a  LEGACY  function  in
       XSH5.0  and is not considered portable to other conforming
       implementations.

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Points  to  the  new effective root directory. If the path
       parameter refers to a symbolic link, the chroot() function
       sets the effective root directory to the directory pointed
       to by the symbolic link.

DESCRIPTION    [Toc]    [Back]

       The chroot() function causes the directory  named  by  the
       path parameter to become the effective root directory.

       The  effective  root  directory is the starting point when
       searching for a file's  pathname  that  begins  with  a  /
       (slash).  The current working directory is not affected by
       the chroot() function.

       The calling process must have superuser privilege in order
       to  change  the effective root directory. The calling process
 must also have search access  to  the  new  effective
       root directory.

       The  .. (dot-dot) entry in the effective root directory is
       interpreted to mean the effective root  directory  itself.
       Thus,  .. (dot-dot) cannot be used to access files outside
       the subtree rooted at the effective root directory.

RETURN VALUES    [Toc]    [Back]

       Upon  successful  completion,  a  value  of  0  (zero)  is
       returned. If the chroot() function fails, a value of -1 is
       returned and errno is set to indicate the error.

ERRORS    [Toc]    [Back]

       If the chroot() function fails, the effective root  directory
  remains unchanged and errno may be set to one of the
       following values: Search permission is denied for any component
  of the pathname.  [Tru64 UNIX]  The path parameter
       points  outside  the  process'  allocated  address  space.
       [Tru64  UNIX]  An I/O error occurred while reading from or
       writing to the file system.  More  than  MAXSYMLINKS  symbolic
  links  are  encountered  while resolving path.  The
       length of the path argument exceeds PATH_MAX or a pathname
       component  is  longer  than  NAME_MAX.  The path parameter
       does not exist or points to an empty string.  A  component
       of  path  is  not  a directory.  The process does not have
       appropriate privilege.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: chdir(2)

       Commands: cd(1)

       Standards: standards(5)



                                                        chroot(2)
[ Back ]
 Similar pages
Name OS Title
chroot IRIX change root directory
chroot OpenBSD change root directory
chroot Linux change root directory
chroot OpenBSD change root directory
fchroot NetBSD change root directory
chroot HP-UX change root directory
chroot NetBSD change root directory
chroot FreeBSD change root directory
chroot FreeBSD change root directory
chroot IRIX change root directory for a command
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service