NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUE | ATTRIBUTES | SEE ALSO
#include <unistd.h>int chroot(const char *dirname);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
MSDOSFS, NFS_CLIENT, UFS
The dirname pointer indicates a pathname identifying a directory. The chroot system call causes the named directory to become the root directory of the calling process. In other words, the named directory becomes the starting point for path searches for pathnames beginning with a slash, /. The process's working directory is unaffected by the chroot system call.
The . (dot) 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.
Upon successful completion, chroot returns 0; otherwise it returns -1 and sets errno to indicate one of the following error conditions:
A component of the pathname is not a directory.
The named directory does not exist.
Search permission is denied for any component of the path name.
path points outside the allocated address space of the process.
The length of a component of path exceeds NAME_MAX characters or the length of path exceeds PATH_MAX characters.
Too many symbolic links or symbolic ports were encountered during analysis of path.
An I/O error occurred while reading from or writing to the file system.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
MT-level | MT-safe |
NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUE | ATTRIBUTES | SEE ALSO