diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index c004303f035f58b9175f3a88a46c0883b5368e75..95220d0bc08b0e3dffef812e2b2931aa98953982 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -162,7 +162,8 @@ (define (scope file)
 (define (namespaces->bit-mask namespaces)
   "Return the number suitable for the 'flags' argument of 'clone' that
 corresponds to the symbols in NAMESPACES."
-  (apply logior SIGCHLD
+  ;; Use the same flags as fork(3) in addition to the namespace flags.
+  (apply logior SIGCHLD CLONE_CHILD_CLEARTID CLONE_CHILD_SETTID
          (map (match-lambda
                ('mnt  CLONE_NEWNS)
                ('uts  CLONE_NEWUTS)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 093eb0a1a0e6a91d0376d0de3dd86f3bf414d7c8..2c2fbde0a3c2fb4eab0b67b24d0c1068e6c1842f 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -50,6 +50,8 @@ (define-module (guix build syscalls)
             mkdtemp!
             pivot-root
 
+            CLONE_CHILD_CLEARTID
+            CLONE_CHILD_SETTID
             CLONE_NEWNS
             CLONE_NEWUTS
             CLONE_NEWIPC
@@ -303,12 +305,14 @@ (define mkdtemp!
         (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.