[PATCH 3/5] add the simple 'pivot_root' syscall, fixes pivot_root

Tias Guns tias at ulyssis.org
Mon Jun 4 20:24:34 UTC 2012


patch modified from 'misc-syscalls' by Dan Drown:
http://dan.drown.org/android/src/busybox/

Signed-off-by: Tias Guns <tias at ulyssis.org>
---
 libbb/Kbuild.src   |    1 +
 libbb/pivot_root.c |    5 +++++
 2 files changed, 6 insertions(+)
 create mode 100644 libbb/pivot_root.c

diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index 1435145..60c351a 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -192,3 +192,4 @@ lib-$(CONFIG_FEATURE_FIND_REGEX) += xregcomp.o
 lib-y += getsid.o
 lib-$(CONFIG_DATE) += stime.o
 lib-$(CONFIG_RDATE) += stime.o
+lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o
diff --git a/libbb/pivot_root.c b/libbb/pivot_root.c
new file mode 100644
index 0000000..73e7ad2
--- /dev/null
+++ b/libbb/pivot_root.c
@@ -0,0 +1,5 @@
+#include <sys/syscall.h>
+
+int pivot_root(const char *new_root, const char *put_old) {
+  return syscall(__NR_pivot_root, new_root, put_old);
+}
-- 
1.7.10



More information about the busybox mailing list