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

  man pages->IRIX man pages -> standard/chroot (2)              


chroot(2)							     chroot(2)

NAME    [Toc]    [Back]

     chroot - change root directory

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     int chroot(const char *path);

DESCRIPTION    [Toc]    [Back]

     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 calling process must have the super-user privilege to change the root

     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.

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

     EACCES	    Search permission is denied	on a component of the

     ELOOP	    Too	many symbolic links were encountered in	translating

     ENAMETOOLONG   The	length of the path argument exceeds {PATH_MAX},	or the
		    length of a	path component exceeds {NAME_MAX} while
		    _POSIX_NO_TRUNC is in effect.

     EFAULT	    path points	outside	the allocated address space of the

     EINTR	    A signal was caught	during the chroot system call.

     EMULTIHOP	    Components of path require hopping to multiple remote
		    machines and file system type does not allow it.

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

     ETIMEDOUT	    The	named directory	is located on a	remote file system
		    which is not available [see	intro(2)].

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

									Page 1

chroot(2)							     chroot(2)

     ENOENT	    The	named directory	does not exist or is a null pathname.

     EPERM	    The	calling	process	does not have the super-user privilege
		    for	changing the root directory.

SEE ALSO    [Toc]    [Back]


DIAGNOSTICS    [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.

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
chroot HP-UX change root directory for a command
chroot IRIX change root directory for a command
chroot Tru64 Change the effective root directory
pivot_root Linux change the root file system
pivot_root Linux change the root file system
chroot Tru64 Changes the root directory of a command
pxfchroot IRIX Changes the root directory to a specified directory
chroot Linux run command or interactive shell with special root directory
fchdir HP-UX change working directory
chdir Linux change working directory
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service