From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52668 invoked by alias); 9 Oct 2016 10:05:51 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 52542 invoked by uid 89); 9 Oct 2016 10:05:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: albireo.enyo.de From: Florian Weimer To: Robert =?utf-8?B?xZp3acSZY2tp?= Cc: GLIBC Devel , Adhemerval Zanella Subject: Re: Caching of PID/TID after fork References: <87y4202blm.fsf@mid.deneb.enyo.de> Date: Sun, 09 Oct 2016 10:05:00 -0000 In-Reply-To: ("Robert \=\?utf-8\?B\?xZp3acSZY2tpIidz\?\= message of "Fri, 7 Oct 2016 23:23:19 +0200") Message-ID: <87mvidj0qw.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-10/txt/msg00180.txt.bz2 * Robert =C5=9Awi=C4=99cki: >> The other question I have is whether we talk about clone-as-fork >> exclusively. Introducing a new thread into the process on which >> non-free-standing code can run using clone is a different matter >> altogether. > > To my knowledge, in the vast majority of cases (or even, in all > cases), where the TID/PID caching problem surfaced, it could have been > solved by fork_with_flags() indeed. So no new thread? Good. > Though, one useful feature which could be potentially useful for some > porjects would be to create a detached process (for which the kernel > doesn't send termination signal - usually SIGCHLD - to the parent > process). And this cannot be solved by ORing custom flags with fork > ones, because SIGCHLD is already there. But, it's just a guess. Yes, I know of some cases where this would have helped as well. If we go the fork-with-flags route, we should translate glibc-specific flags to kernel flags anyway because the kernel might introduce new flags which break the interface in subtle ways (see O_TMPFILE and mode argument handling).