Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernie Innocenti <bernie@codewiz.org>2008-12-18 04:13:01 (GMT)
committer Bernie Innocenti <bernie@codewiz.org>2008-12-18 04:13:01 (GMT)
commitf2105d2d2611af39d22deb9f11dbfcb01224901a (patch)
tree183b8c8a3fecdbca893fff7d5e5b5085f3700416
parent2ae00c3fe13ad830522a4a132ba57ef4b1cc36dc (diff)
Use the glibc wrapper for unshare, which will be platform independent.
-rw-r--r--rainbow/rainbow/util.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/rainbow/rainbow/util.py b/rainbow/rainbow/util.py
index 24c3a03..be78711 100644
--- a/rainbow/rainbow/util.py
+++ b/rainbow/rainbow/util.py
@@ -240,19 +240,20 @@ syscall = libc.syscall
# int clone(int number, int flags, void *child_stack, int *parent_tidptr, int *child_tidptr)
SYS_clone = 120
-SYS_unshare = 310
def clone(flags):
"""Perform sys_clone() system call, which creates a new process in
a manner similar to fork(). If flags is SIGCHLD, then this is
- identical to fork()."""
+ identical to fork().
+ XXX: i386 wrapper. <MS>"""
return libc_errcheck(syscall(SYS_clone, flags, None), None, None)
-def unshare(flags):
- """Perform sys_unshare() system call, which allows the calling process
- to disassociate part of its execution context from that part of its
- execution context which is shared with other processes."""
- return libc_errcheck(syscall(SYS_unshare, flags, None), None, None)
+# int unshare(int flags);
+unshare = libc.unshare
+unshare.__doc__ = "Libc's unshare call; see unshare (2)"
+unshare.argtypes = [c_int]
+unshare.restype = c_int
+unshare.errcheck = libc_errcheck
# int daemon(int nochdir, int noclose);
daemon = libc.daemon