From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60581 invoked by alias); 2 Jul 2018 19:58:39 -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 60571 invoked by uid 89); 2 Jul 2018 19:58:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Never X-HELO: zimbra.cs.ucla.edu Subject: Re: [PATCH] Add renameat2 function [BZ #17662] To: Joseph Myers Cc: Florian Weimer , libc-alpha@sourceware.org, Gnulib bugs References: <20180630121447.E4C8643994575@oldenburg.str.redhat.com> <4a9cb334-48f4-139f-d917-457ce8ece57a@cs.ucla.edu> From: Paul Eggert Openpgp: preference=signencrypt Message-ID: <2eabb25a-a10e-11ca-efb5-fb8fb484bf31@cs.ucla.edu> Date: Mon, 02 Jul 2018 19:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-07/txt/msg00040.txt.bz2 Joseph Myers wrote: > We've had complaints in glibc about fallbacks that introduce races (e.g. > for pselect). Do > you have reason to believe that this race is somehow different and > introducing it will never cause problems for users? "Never" is a pretty strong word, and I don't know that it's true here. I do= know=20 that the uses of Gnulib renameat2 don't have any problems with races that t= hey=20 wouldn't have with their own fallbacks, and I haven't yet run into a potent= ial=20 case that would differ from this. If the requirement is "never", then let's go with another flag=20 (RENAME_NONATOMIC, say), that can be ORed in to allow renameat2 to behave=20 non-atomically. This flag would not be passed to the Linux kernel syscall; = it=20 would affect only the user-mode fallback code.