summaryrefslogtreecommitdiffstats
path: root/usr/utils/pivot_root.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/utils/pivot_root.c')
-rw-r--r--usr/utils/pivot_root.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/usr/utils/pivot_root.c b/usr/utils/pivot_root.c
new file mode 100644
index 0000000..41b2ea0
--- /dev/null
+++ b/usr/utils/pivot_root.c
@@ -0,0 +1,19 @@
+/* Change the root file system */
+
+/* Written 2000 by Werner Almesberger */
+
+#include <stdio.h>
+#include <sys/mount.h>
+
+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;
+}