add linux-specific unshare syscall wrapper
authorRich Felker <dalias@aerifal.cx>
Sun, 29 Apr 2012 23:54:03 +0000 (19:54 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 29 Apr 2012 23:54:03 +0000 (19:54 -0400)
include/sched.h
src/linux/unshare.c [new file with mode: 0644]

index 7b3f1600481c27dce8eb5ba420ddb3a0a3b4d664..e411c92b84d30b06663eef7b63f80ed8ce3a2fc9 100644 (file)
@@ -56,6 +56,7 @@ int     sched_yield(void);
 #define CLONE_NEWNET   0x40000000
 #define CLONE_IO       0x80000000
 int clone (int (*)(void *), void *, int, void *, ...);
+int unshare(int);
 #endif
 
 #ifdef __cplusplus
diff --git a/src/linux/unshare.c b/src/linux/unshare.c
new file mode 100644 (file)
index 0000000..3861db3
--- /dev/null
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <sched.h>
+#include "syscall.h"
+
+int unshare(int flags)
+{
+       return syscall(SYS_unshare, flags);
+}