summaryrefslogtreecommitdiff
path: root/guix/build/syscalls.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-11-18 22:17:26 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-11-20 08:57:00 -0500
commit8444b44a8c7ae67c11dee22f99b0a7b6a431d29d (patch)
tree82391281741e53b7c021ce4ec4a772a9fc96f062 /guix/build/syscalls.scm
parent83580b949d31a48139167f1fac9f4d9bdd7a0175 (diff)
build: syscalls: Add a SET-CHILD-SUBREAPER! procedure.
* guix/build/syscalls.scm (PR_SET_CHILD_SUBREAPER): New variable. (set-child-subreaper!): New procedure.
Diffstat (limited to 'guix/build/syscalls.scm')
-rw-r--r--guix/build/syscalls.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index b305133c37..15b2ea6ff3 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -120,6 +120,8 @@
with-file-lock
with-file-lock/no-wait
+ set-child-subreaper!
+
set-thread-name
thread-name
@@ -1421,6 +1423,11 @@ handler if the lock is already held by another process."
(define PR_SET_NAME 15) ;<linux/prctl.h>
(define PR_GET_NAME 16)
+(define PR_SET_CHILD_SUBREAPER 36)
+
+(define (set-child-subreaper!)
+ "Set the CHILD_SUBREAPER capability for the current process."
+ (%prctl PR_SET_CHILD_SUBREAPER 1 0 0 0))
(define %max-thread-name-length
;; Maximum length in bytes of the process name, including the terminating