Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
chroot(2)		      System Calls Manual		     chroot(2)

NAME
       chroot -	change root directory

SYNOPSIS
DESCRIPTION
       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 unaf-
       fected by the 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	direc-
       tory itself.  Thus, cannot be used to access files outside the  subtree
       rooted at the root directory.

RETURN VALUE
       Upon  successful	 completion,  a	 value of 0 is returned.  Otherwise, a
       value of	-1 is returned and is set to indicate the error.

ERRORS
       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  ad-
				       dress  space of the process.  The reli-
				       able detection of this error is	imple-
				       mentation dependent.

	      [ENAMETOOLONG]	       The  length  of the specified path name
				       exceeds bytes, or the length of a  com-
				       ponent  of  the path name exceeds bytes
				       while is	in effect.

	      [ELOOP]		       Too many	symbolic  links	 were  encoun-
				       tered in	translating the	path name.

WARNINGS
   Obsolescent Interfaces
       is to be	obsoleted at a future date.

SEE ALSO
       chroot(1M), chdir(2).

STANDARDS CONFORMANCE
				TO BE OBSOLETED			     chroot(2)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | WARNINGS | SEE ALSO | STANDARDS CONFORMANCE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=chroot&sektion=2&manpath=HP-UX+11.22>

home | help