summaryrefslogtreecommitdiffstats
path: root/mount/pivot_root.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:43 +0100
committerKarel Zak2006-12-07 00:25:43 +0100
commit22853e4a82c6ef7b336527529acb94b14a0b0fd8 (patch)
treeee28e4598c8c449d7e811711d8ce8eb17caecfb6 /mount/pivot_root.c
parentImported from util-linux-2.10f tarball. (diff)
downloadkernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.gz
kernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.xz
kernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.zip
Imported from util-linux-2.10m tarball.
Diffstat (limited to 'mount/pivot_root.c')
-rw-r--r--mount/pivot_root.c24
1 files changed, 24 insertions, 0 deletions
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 <stdio.h>
+#include <linux/unistd.h>
+
+
+_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;
+}