From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 163CC393BA56 for ; Mon, 5 Dec 2022 16:40:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 163CC393BA56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670258423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JRjAucEL+07U0eoMCin0Y1nxO5mwgTjAutG8cZSMVcQ=; b=fQ7Fp3TL/PRglY1UpbJ1YBazUqVd2OzexBje76POv0nQ2H/TWfzwrP1MqNt1tl31VjYesv 66xEp398t9lZmFZDb8Le51BJkdnhlTTURtPEM/SpVgUpNc5k05o+gfv9OLICoku07wtR1o R9wHENqKLWDR+9Gm8JTk08clTP4+VlQ= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-518-1Re-HJADMz66Copl8PKfWQ-1; Mon, 05 Dec 2022 11:40:21 -0500 X-MC-Unique: 1Re-HJADMz66Copl8PKfWQ-1 Received: by mail-il1-f199.google.com with SMTP id i7-20020a056e021b0700b003033a763270so11166007ilv.19 for ; Mon, 05 Dec 2022 08:40:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JRjAucEL+07U0eoMCin0Y1nxO5mwgTjAutG8cZSMVcQ=; b=rgryEeIEaVwe0hC34qUiSfH7kZWlH58IRxBkbIDnsSIUzviiITsMoGIieFXSVFdbcc nV+oxtxrHMvKl2pRUSSVuWKzeSdZl87HrzSh/Bj1mBjJlBcME9nA4trj3DkdPSBEnjwE XUzdGa1VDyFeXLcpVSiEMR59x1Kx1FLTA43IoAecPxNcUbODMdvFt3FqttRVCAEkzzY6 hnAaneQYdQth9wjFtQPzMH+BI+WEH2+W/x6k+XXUOVQLmm8ari1iIlWCxFBybRnEC3ux MLSTdk/edjazmiY23OxYzIRw7Ix5U16oFVv4txy4VQf8OKtg/zCenU41HNM7Vjq3zsXr gDoA== X-Gm-Message-State: ANoB5pmGYHGZF6oMYs2ymOzwBRkiHE4sdjkhKp2kOMbC1HxIKJwEz3l3 jSaBJV9A0fn236vXjlVIOpkPKiyIMf0wDxGW9+5dagBdaJhZL9irCwR9CUzkikUvYChdf9pMNi+ xmH9SPUWjAAhoS2aC4NVX X-Received: by 2002:a6b:b209:0:b0:6df:e6e9:6e1e with SMTP id b9-20020a6bb209000000b006dfe6e96e1emr6822738iof.78.1670258420258; Mon, 05 Dec 2022 08:40:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zwzvgwD9UwsjmBSknSWGNnTODL+/QBhFXX4GchOWjhtOoTgdzrKrnjTrgYNg3oXJRFE9dcA== X-Received: by 2002:a6b:b209:0:b0:6df:e6e9:6e1e with SMTP id b9-20020a6bb209000000b006dfe6e96e1emr6822731iof.78.1670258420030; Mon, 05 Dec 2022 08:40:20 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id h34-20020a022b22000000b0037599d3630dsm5889135jaa.28.2022.12.05.08.40.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 08:40:19 -0800 (PST) Message-ID: <5426e045-359e-318d-9a27-dc39636eb21d@redhat.com> Date: Mon, 5 Dec 2022 11:40:18 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 14/30] Linux: consolidate unlink implementation To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-15-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221019221433.1082017-15-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > Use unlink syscall if defined, otherwise use unlinkat. > > Checked on x86_64-linux-gnu. LGTM. No regressions on x86_64 and i686. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > --- > sysdeps/unix/sysv/linux/{generic => }/unlink.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > rename sysdeps/unix/sysv/linux/{generic => }/unlink.c (77%) > > diff --git a/sysdeps/unix/sysv/linux/generic/unlink.c b/sysdeps/unix/sysv/linux/unlink.c > similarity index 77% > rename from sysdeps/unix/sysv/linux/generic/unlink.c > rename to sysdeps/unix/sysv/linux/unlink.c > index d2650acacc..e17b0a82d2 100644 > --- a/sysdeps/unix/sysv/linux/generic/unlink.c > +++ b/sysdeps/unix/sysv/linux/unlink.c > @@ -1,4 +1,5 @@ > -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. > +/* Delete a name and possibly the file it refers to. Linux version. > + Copyright (C) 2011-2022 Free Software Foundation, Inc. > This file is part of the GNU C Library. > > The GNU C Library is free software; you can redistribute it and/or > @@ -23,6 +24,10 @@ > int > __unlink (const char *name) > { > - return INLINE_SYSCALL (unlinkat, 3, AT_FDCWD, name, 0); > +#ifdef __NR_unlink > + return INLINE_SYSCALL_CALL (unlink, name); > +#else > + return INLINE_SYSCALL_CALL (unlinkat, AT_FDCWD, name, 0); OK. > +#endif > } > weak_alias (__unlink, unlink) -- Cheers, Carlos.