From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6302 invoked by alias); 9 Oct 2016 14:19:34 -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 6292 invoked by uid 89); 9 Oct 2016 14:19:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=o_tmpfile, fork-with-flags, forkwithflags, O_TMPFILE X-HELO: mail-qk0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=udP3UmWNESbii+RPuUw+WQjoYkB8F4ZWUK+k45675Dc=; b=gzE7/qGsk8M1IoWBx22j7jZ+AFwYBcCBy6ydAYs23cYwx5YTx/uHDE5whReaJB6xPv Jsi5ybjtV9IXDTti4cFF8PUeIoLQ6HrO5t/IgXF5hh4Nmfa0vFkg7PtGsBnAhgdX7Z5W ouEQz1TA4EOC9uMtlzgtGdcpyWFvLLwaW0IOaEGWFpxWS7rHOKcwkyzdmMlv/FkZ6Pxd Izj70ltdmDf1Nug4FWrGOFmuPd4RyzWIf0hRrdJwVBifc2XP1j92ZIQwkOy1F1wSdUoF H309ji2X7V5yr6Mrtq6Apc0KKej9P3yJJujE72kSIz30R0Nzq3CeFxiyLqBDcrP/GZmE E3Xg== X-Gm-Message-State: AA6/9RnlZgVlVOO0MPYHxHp56kJuW5HFR/6n/BnoSeJRJUGyT9vZIJsTj6fPb0W1LMRslOzZuZFiZUsnHE20gA== X-Received: by 10.55.207.16 with SMTP id e16mr30095558qkj.4.1476022761245; Sun, 09 Oct 2016 07:19:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87mvidj0qw.fsf@mid.deneb.enyo.de> References: <87y4202blm.fsf@mid.deneb.enyo.de> <87mvidj0qw.fsf@mid.deneb.enyo.de> From: =?UTF-8?B?Um9iZXJ0IMWad2nEmWNraQ==?= Date: Sun, 09 Oct 2016 14:19:00 -0000 Message-ID: Subject: Re: Caching of PID/TID after fork To: Florian Weimer Cc: GLIBC Devel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-10/txt/msg00181.txt.bz2 >> 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). An initial stab at the interface; it should avoid the problem you've described above? I don't think additional rewrite of clone flags would be required with such interface, even with future changes in the kernel - in any case, using it requires good understanding of the underlying kernel's clone() interface. /* fork with flags */ pid_t ffork(int mode, unsigned long flags); mode: FFORK_FLAG_SET - set flags directly FFORK_FLAG_OR - append flags to whatever fork uses internally flags: as with clone() ret val / errno: as with fork() --=20 Robert =C5=9Awi=C4=99cki