[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] build: container: Use the same clone flags as fork(3).
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] build: container: Use the same clone flags as fork(3). |
Date: |
Mon, 07 Sep 2015 18:13:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
David Thompson <address@hidden> skribis:
> This patch resolves an issue I was having when working with containers
> at the REPL, which means it probably presented undetected issues
> elsewhere.
Calling ‘primitive-fork’ at the REPL is not very useful anyway since you
end up with two Guiles trying to read from the same tty.
> From 61ebbe55f7f6d4d4eb42db957d6fc7b4eaf282a6 Mon Sep 17 00:00:00 2001
> From: David Thompson <address@hidden>
> Date: Sat, 5 Sep 2015 14:10:08 -0400
> Subject: [PATCH] build: container: Use the same clone flags as fork(3).
>
> The intent is to make 'clone' behave a lot more like 'primitive-fork', which
> calls clone(2) with SIGCHLD, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
> flags. Notably, running 'clone' at the REPL without these flags would break
> the REPL beyond repair.
>
> * guix/build/syscalls.scm (CLONE_CHILD_CLEARTID, CLONE_CHILD_SETTID): New
> variables.
> * gnu/build/linux-container.scm (namespaces->bit-mask): Add
> CLONE_CHILD_CLEARTID and CLONE_CHILD_SETTID to bit mask.
Looking at clone(2) and libc, I’m guessing that without these flags, the
child would have a wrong idea of its thread ID, which in turn may cause
all sorts of problems, right?
LGTM.
Thanks,
Ludo’.