From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85478 invoked by alias); 21 Apr 2017 14:24:35 -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 85218 invoked by uid 89); 21 Apr 2017 14:24:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1476C235379 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1476C235379 Subject: Re: [PATCH v3][BZ 21340] add support for POSIX_SPAWN_SETSID To: Adhemerval Zanella , libc-alpha@sourceware.org Cc: Zack Weinberg References: <20170405054116.9007-1-quae@daurnimator.com> <75eb12d0-a3f1-2b37-90d5-0a9a3f7f9a99@redhat.com> From: Florian Weimer Message-ID: Date: Fri, 21 Apr 2017 14:24:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-04/txt/msg00462.txt.bz2 On 04/21/2017 04:13 PM, Adhemerval Zanella wrote: > * conform/data/spawn.h-data: Add POSIX_SPAWN_SETSID flag. I think this has to go away ... > diff --git a/posix/spawn.h b/posix/spawn.h > index 36e3867..8d2ace1 100644 > --- a/posix/spawn.h > +++ b/posix/spawn.h > @@ -60,6 +60,7 @@ typedef struct > #ifdef __USE_GNU > # define POSIX_SPAWN_USEVFORK 0x40 > #endif > +#define POSIX_SPAWN_SETSID 0x80 ... because this has to be governed by __GNU_SOURCE. > +static int > +do_test (void) > +{ > + pid_t sid, child_sid; > + int res; > + > + /* Current session ID. */ > + sid = getsid(0); > + if (sid == (pid_t) -1) > + FAIL_EXIT1 ("getsid (0): %m"); > + > + posix_spawnattr_t attrp; > + posix_spawnattr_init (&attrp); > + if (posix_spawnattr_setflags (&attrp, POSIX_SPAWN_SETSID)) > + FAIL_EXIT1 ("posix_spawnattr_setflags: %m"); Please run the test twice, once with setting POSIX_SPAWN_SETSID, and once without. Thanks, Florian