summaryrefslogtreecommitdiff
path: root/guix/build/syscalls.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-09-13 21:28:01 +0200
committerLudovic Courtès <ludo@gnu.org>2015-09-13 21:28:01 +0200
commit75710da66710cef1d32053cd8f350d13057d02a7 (patch)
treeabef6a326c741b1eb18db866b2f2bacee3e5fc51 /guix/build/syscalls.scm
parentab20c2cc33063ce783515d8ae7899ec7e2ca6f96 (diff)
parent610075f7c94c80b8321887b7ccf8bb1a7edd2b8e (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/build/syscalls.scm')
-rw-r--r--guix/build/syscalls.scm24
1 files changed, 17 insertions, 7 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index fc801a5e9d..2c2fbde0a3 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -50,6 +50,8 @@
mkdtemp!
pivot-root
+ CLONE_CHILD_CLEARTID
+ CLONE_CHILD_SETTID
CLONE_NEWNS
CLONE_NEWUTS
CLONE_NEWIPC
@@ -303,12 +305,14 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'."
(pointer->string result)))))
;; Linux clone flags, from linux/sched.h
-(define CLONE_NEWNS #x00020000)
-(define CLONE_NEWUTS #x04000000)
-(define CLONE_NEWIPC #x08000000)
-(define CLONE_NEWUSER #x10000000)
-(define CLONE_NEWPID #x20000000)
-(define CLONE_NEWNET #x40000000)
+(define CLONE_CHILD_CLEARTID #x00200000)
+(define CLONE_CHILD_SETTID #x01000000)
+(define CLONE_NEWNS #x00020000)
+(define CLONE_NEWUTS #x04000000)
+(define CLONE_NEWIPC #x08000000)
+(define CLONE_NEWUSER #x10000000)
+(define CLONE_NEWPID #x20000000)
+(define CLONE_NEWNET #x40000000)
;; The libc interface to sys_clone is not useful for Scheme programs, so the
;; low-level system call is wrapped instead.
@@ -325,7 +329,13 @@ string TMPL and return its file name. TMPL must end with 'XXXXXX'."
"Create a new child process by duplicating the current parent process.
Unlike the fork system call, clone accepts FLAGS that specify which resources
are shared between the parent and child processes."
- (proc syscall-id flags %null-pointer))))
+ (let ((ret (proc syscall-id flags %null-pointer))
+ (err (errno)))
+ (if (= ret -1)
+ (throw 'system-error "clone" "~d: ~A"
+ (list flags (strerror err))
+ (list err))
+ ret)))))
(define setns
;; Some systems may be using an old (pre-2.14) version of glibc where there