From: Sascha Wildner Date: Sun, 1 Aug 2010 08:06:40 +0000 (+0200) Subject: chroot.2: Add some words about chroot_kernel(). X-Git-Tag: v2.9.0~632 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/734a0c8d34886c33101adc5690c9837f5803dbb7 chroot.2: Add some words about chroot_kernel(). --- diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 7bd1592af0..edd502fb77 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -105,6 +105,7 @@ MLINKS+=chdir.2 fchdir.2 MLINKS+=chflags.2 fchflags.2 chflags.2 lchflags.2 MLINKS+=chmod.2 fchmod.2 chmod.2 lchmod.2 chmod.2 fchmodat.2 MLINKS+=chown.2 fchown.2 chown.2 lchown.2 chown.2 fchownat.2 +MLINKS+=chroot.2 chroot_kernel.2 MLINKS+=clock_gettime.2 clock_getres.2 clock_gettime.2 clock_settime.2 MLINKS+=dup.2 dup2.2 MLINKS+=extattr.2 extattr_delete_file.2 \ diff --git a/lib/libc/sys/chroot.2 b/lib/libc/sys/chroot.2 index fb48cbeaae..bfd2e4fd1e 100644 --- a/lib/libc/sys/chroot.2 +++ b/lib/libc/sys/chroot.2 @@ -31,9 +31,8 @@ .\" .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD: src/lib/libc/sys/chroot.2,v 1.7.2.8 2002/12/11 14:06:37 ru Exp $ -.\" $DragonFly: src/lib/libc/sys/chroot.2,v 1.3 2007/07/14 21:48:15 swildner Exp $ .\" -.Dd June 4, 1993 +.Dd August 1, 2010 .Dt CHROOT 2 .Os .Sh NAME @@ -45,6 +44,8 @@ .In unistd.h .Ft int .Fn chroot "const char *dirname" +.Ft int +.Fn chroot_kernel "const char *dirname" .Sh DESCRIPTION .Fa Dirname is the address of the pathname of a directory, terminated by an ASCII NUL. @@ -99,6 +100,16 @@ Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and .Va errno is set to indicate an error. +.Pp +The +.Fn chroot_kernel +system call adjusts the kernel's internal namecache and root vnode +references to +.Fa dirname . +If used in conjunction with +.Fn chroot +during early boot, it allows for changing the root mount to any +mount point available at that time. .Sh ERRORS .Fn Chroot will fail and the root directory will be unchanged if: