From 22853e4a82c6ef7b336527529acb94b14a0b0fd8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:43 +0100 Subject: Imported from util-linux-2.10m tarball. --- mount/pivot_root.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 mount/pivot_root.c (limited to 'mount/pivot_root.c') diff --git a/mount/pivot_root.c b/mount/pivot_root.c new file mode 100644 index 000000000..4ab8be853 --- /dev/null +++ b/mount/pivot_root.c @@ -0,0 +1,24 @@ +/* pivot_root.c - Change the root file system */ + +/* Written 2000 by Werner Almesberger */ + + +#include +#include + + +_syscall2(int,pivot_root,const char *,new_root,const char *,put_old) + + +int main(int argc,const char **argv) +{ + if (argc != 3) { + fprintf(stderr,"usage: %s new_root put_old\n",argv[0]); + return 1; + } + if (pivot_root(argv[1],argv[2]) < 0) { + perror("pivot_root"); + return 1; + } + return 0; +} -- cgit v1.2.3-55-g7522