From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] build: container: Use the same clone flags as fork(3). Date: Mon, 07 Sep 2015 18:13:16 +0200 Message-ID: <87mvwyryw3.fsf@gnu.org> References: <87twr84tlv.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYz2p-0002ke-QT for guix-devel@gnu.org; Mon, 07 Sep 2015 12:13:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYz2m-0003fQ-Lo for guix-devel@gnu.org; Mon, 07 Sep 2015 12:13:23 -0400 In-Reply-To: <87twr84tlv.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Sat, 05 Sep 2015 14:19:08 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org David Thompson 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 =E2=80=98primitive-fork=E2=80=99 at the REPL is not very useful any= way 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 > 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', wh= ich > calls clone(2) with SIGCHLD, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID > flags. Notably, running 'clone' at the REPL without these flags would br= eak > 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=E2=80=99m 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=E2=80=99.