Go to the previous, next section.
int chroot(const char *path);
path: [in] points to the new root.
Changes the root directory for the current task and all its children to the path specified by path. This operation is privilegied and only the superuser can invoke it successfully.
On success zero is returned. On error, -1 is returned and errno
is
set to one of the following values:
EPERM
: the effective uid of the task is not equal the the
uid of the file and the task does not have superuser privileges.
ENOTDIR
, EACCESS
, EFAULT
, ENOENT
,
ENOMEM
ENAMETOOLONG
, EROFS
or ELOOP
.
Go to the previous, next section.