.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified by Michael Haardt .\" Modified Wed Jul 21 22:18:17 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 21 Aug 1994 by Michael Chastain (mec@shell.portal.com): .\" Fixed typoes. .\" Translated 20 Dec 1995 Miguel A. Sepulveda (miguel@typhoon.harvard.edu) .\" Modified 1 Jul 1996 Miguel A. Sepulveda (angel@vivaldi.princeton.edu) .\" Modified 13 Jun 1996 by aeb - Added a warning: . may be outside / tree. .\" Modified Wed Nov 6 03:50:45 1996 by Eric S. Raymond .\" Modified by Joseph S. Myers , 970821 .\" Translation revised 21 April 1998 by Juan Piernas .\" Revisado por Miguel Pérez Ibars el 29-septiembre-2004 .\" .TH CHROOT 2 "21 agosto 1997" "Linux 2.0.30" "Manual del Programador de Linux" .SH NOMBRE chroot \- cambia el directorio raíz. .SH SINOPSIS .B #include .sp .BI "int chroot(const char *" path ); .SH DESCRIPCIÓN .B chroot cambia el directorio raíz a aquel especificado en .IR path . Este directorio será usado como raíz para aquellos nombres de camino que comiencen por /. El directorio raíz es heredado por todos los descendientes del proceso actual. Solamente el superusuario puede cambiar el directorio raíz. Note que esta llamada no cambia el directorio de trabajo actual, por lo que el directorio '.' puede estar fuera del árbol enraizado en '/'. En particular, el super-usuario puede escapar de una `prisión chroot' haciendo `mkdir foo; chroot foo; cd ..'. .SH "VALOR DEVUELTO" En caso de éxito 0, si hay algún error, \-1, y a la variable .I errno se le asigna un valor adecuado. .SH ERRORES Según el sistema de ficheros, se pueden obtener otros errores. Los errores más comunes se listan a continuación: .TP .B EPERM El UID efectivo no es 0. .TP .B EFAULT .I path apunta fuera de su espacio de direcciones accesibles. .TP .B ENAMETOOLONG .I path es demasiado largo. .TP .B ENOENT El fichero no existe. .TP .B ENOMEM No había suficiente memoria disponible en el núcleo. .TP .B ENOTDIR Un componente del camino .I path no es un directorio. .TP .B EACCES Permiso de búsqueda denegado en uno de los componentes del camino .IR path . .TP .B ELOOP Se encontraron demasiados enlaces simbólicos al resolver .IR path . .TP .B EIO Ocurrió un error de E/S. .SH CONFORME A SVr4, SVID, 4.4BSD y X/OPEN. Esta función no es parte de POSIX.1. SVr4 documenta además las condiciones de error EINTR, ENOLINK y EMULTIHOP. X/OPEN no documenta las condiciones de error EIO, ENOMEM ni EFAULT. Esta interfaz es clasificada por X/OPEN como legado. .SH "VÉASE TAMBIÉN" .BR chdir (2)