diff options
author | Karel Zak | 2006-12-07 00:25:43 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:25:43 +0100 |
commit | 22853e4a82c6ef7b336527529acb94b14a0b0fd8 (patch) | |
tree | ee28e4598c8c449d7e811711d8ce8eb17caecfb6 /mount/pivot_root.c | |
parent | Imported from util-linux-2.10f tarball. (diff) | |
download | kernel-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.c | 24 |
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; +} |