Add pivot_root(8)

This commit is contained in:
sin 2013-08-14 14:38:56 +01:00
parent 76614ae86b
commit a4de4eb539
2 changed files with 29 additions and 0 deletions

View File

@ -17,6 +17,7 @@ SRC = \
lsmod.c \ lsmod.c \
mkswap.c \ mkswap.c \
mount.c \ mount.c \
pivot_root.c \
reboot.c \ reboot.c \
rmmod.c \ rmmod.c \
stat.c \ stat.c \

28
pivot_root.c Normal file
View File

@ -0,0 +1,28 @@
/* See LICENSE file for copyright and license details. */
#include <sys/syscall.h>
#include <unistd.h>
#include <stdio.h>
#include "util.h"
static void
usage(void)
{
eprintf("usage: %s new-root put-old\n", argv0);
}
int
main(int argc, char *argv[])
{
ARGBEGIN {
default:
usage();
} ARGEND;
if (argc < 2)
usage();
if (syscall(SYS_pivot_root, argv[0], argv[1]) < 0)
eprintf("pivot_root:");
return 0;
}