[PATCH 1/5] add the simple 'getsid' syscall, fixes kill and friends

Tias Guns tias at ulyssis.org
Mon Jun 4 20:24:32 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 |    3 +++
 libbb/getsid.c   |    6 ++++++
 2 files changed, 9 insertions(+)
 create mode 100644 libbb/getsid.c

diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index 61eec26..98031f4 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -187,3 +187,6 @@ lib-$(CONFIG_PGREP) += xregcomp.o
 lib-$(CONFIG_PKILL) += xregcomp.o
 lib-$(CONFIG_DEVFSD) += xregcomp.o
 lib-$(CONFIG_FEATURE_FIND_REGEX) += xregcomp.o
+
+# for android-busybox-ndk
+lib-y += getsid.o
diff --git a/libbb/getsid.c b/libbb/getsid.c
new file mode 100644
index 0000000..a938bd5
--- /dev/null
+++ b/libbb/getsid.c
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <sys/syscall.h>
+
+pid_t getsid(pid_t pid) {
+  return syscall(__NR_getsid, pid);
+}
-- 
1.7.10



More information about the busybox mailing list