From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120365 invoked by alias); 2 Feb 2016 13:31:47 -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 120348 invoked by uid 89); 2 Feb 2016 13:31:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qg0-f49.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=44eHBD0kuY/LAHwj8UlX7C7YQZwV5F5LaR9GV70ej4E=; b=k8wlObS4x3Kxes8NGZMomQEeoC4AKWRP5veZbB7QXFSe0iu5HHUBS2JZk2pJ7I5M+t Jh+sEwOshhwlc9JZfiDn4tNJAQqrWSWBcdtH2Juiw9EeOOd3wgjtitTvvk8JVWYJCFtN u/hBkPeOx5pwT51iuaLWcvXlynJ4zOZby7bpQL8OKN21qoFOA5N/J2ucjFH5+WFF6Lyl /MQAyIpXWls+qQmFFtOw3y2/aTqw67LtBsQEHVprWaEZUGgMOMna7lyBk3fz5+LFv80h XVCLyFNtrPjyNlErMGGjxkTmt+RRt166kcXWmYPFfcKj3DTluVBaD5pdd1k51+9uwrhY A68Q== X-Gm-Message-State: AG10YORI2Z4p8yqPorIOFfpLgmGB/yehPvZoxL9f/F8xn6SKcnf6g3JOhiYj7ql4gPGQKnuj X-Received: by 10.140.102.11 with SMTP id v11mr35714142qge.39.1454419902848; Tue, 02 Feb 2016 05:31:42 -0800 (PST) Subject: Re: [PATCH v2 3/3] posix: New Linux posix_spawn{p} implementation To: Florian Weimer References: <1454343665-1706-1-git-send-email-adhemerval.zanella@linaro.org> <1454343665-1706-4-git-send-email-adhemerval.zanella@linaro.org> <56B0A9B7.6000507@redhat.com> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <56B0AFBB.4050402@linaro.org> Date: Tue, 02 Feb 2016 13:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56B0A9B7.6000507@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00042.txt.bz2 On 02-02-2016 11:05, Florian Weimer wrote: > On 02/01/2016 05:21 PM, Adhemerval Zanella wrote: > >> + new_pid = CLONE (__spawni_child, STACK (stack, stack_size), >> + CLONE_VM | CLONE_VFORK | SIGCHLD, &args); > > Does this set up new per-thread variables? Otherwise, errno in the > parent and child will be same and the code still has races. > > Florian > Could you elaborate? In my understanding there is no requirement of using CLONE_SETTLS to avoid races: CLONE_VFORK will suspend the calling process and even with child using the same TLS namespace as the parent there will be no concurrent access between them.