From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0778B1F601 for ; Mon, 5 Dec 2022 16:41:04 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Ca6blHBH"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EC9F394CC2E for ; Mon, 5 Dec 2022 16:41:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EC9F394CC2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670258463; bh=SeZ5xFPAPo6uc96hqamZRBFS0hSGcqb1Qq3jwlQe6rI=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Ca6blHBHy0Xnx6/3Bi8jGZEPC0bZmwIQjNJO8q3ce967NVnveZuLuqZph5obM6hmW 5UdDy/OkIXWAR2DbBJBhgQJLuhUuLQEmjNyR1HFlKJo32e4ltS5JUwAc5rUqO/5q3O 9ZDViBokYNwKUIstSCzMdbylfL0KUT6Q5bhe3dMk= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E7B153942000 for ; Mon, 5 Dec 2022 16:39:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7B153942000 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-133-E-iu4Z1COYa2rABorpzVVw-1; Mon, 05 Dec 2022 11:39:56 -0500 X-MC-Unique: E-iu4Z1COYa2rABorpzVVw-1 Received: by mail-io1-f72.google.com with SMTP id h21-20020a05660224d500b006debd7dedccso10107014ioe.9 for ; Mon, 05 Dec 2022 08:39:56 -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=SeZ5xFPAPo6uc96hqamZRBFS0hSGcqb1Qq3jwlQe6rI=; b=ybc76if+y20pRihJ4PQhA41j1rJY3VGDn3U3v/zjjHcljOg7H5mBA3RmwGgp12256k L5S7Jba4yAM2iV48vkWDROgVydbKnqoUOJUnmMH89P4wD6AhuE9UFp8c3dPZwZ6LMNul 0HkcGRDotbGdlpvB2MDPd2yxdI8sHsRUZ2qekAp3vGSbSWFC2BF3D+scxkmTBo2XPdM2 OfAyppf06KPDs14bu5dLuFHHfxSn9C/2O1tizP35VzhMbjoxVtkTVbJJmEG6AIHOZPZV 9pzsuicuAl+IoWxu53XhpUXXmWhb5vQPv2DYkM1q0IblcFi3HrFqfE5j6wyE0zeg+obh Zs2A== X-Gm-Message-State: ANoB5pljM3tZGr9OBTZV7SA91bb0ttXkZPJpqVe+12VaGCbBxYKs/y9P 2XlVYIY19maZPVOxMQqQXkjfYhQycn9w3XmBcQgJzwydVHgkjEAJQN5E/fOq9SRHOz2J7fwVG2j SYMIp2rPCBFsZxN6tVQD4 X-Received: by 2002:a05:6638:3b9:b0:38a:49b8:bc49 with SMTP id z25-20020a05663803b900b0038a49b8bc49mr2239229jap.66.1670258395612; Mon, 05 Dec 2022 08:39:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6aXvMdCHR4Y7FwzS4et3uf5H0EaTh7FFH98gYjEeEDuqxCDhRCDDBw+xI/US++U3AzW70Lzg== X-Received: by 2002:a05:6638:3b9:b0:38a:49b8:bc49 with SMTP id z25-20020a05663803b900b0038a49b8bc49mr2239221jap.66.1670258395338; Mon, 05 Dec 2022 08:39:55 -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 v7-20020a92d247000000b00302a7165d9bsm5239383ilg.53.2022.12.05.08.39.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 08:39:55 -0800 (PST) Message-ID: <6fc838c9-4f7c-a6fc-e579-8e16deaef44f@redhat.com> Date: Mon, 5 Dec 2022 11:39:54 -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 03/30] Linux: consolidate chmod implementation To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-4-adhemerval.zanella@linaro.org> Organization: Red Hat In-Reply-To: <20221019221433.1082017-4-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-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > Use chmod syscall if defined, otherwise use fchmodat. > > 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 => }/chmod.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > rename sysdeps/unix/sysv/linux/{generic => }/chmod.c (78%) > > diff --git a/sysdeps/unix/sysv/linux/generic/chmod.c b/sysdeps/unix/sysv/linux/chmod.c > similarity index 78% > rename from sysdeps/unix/sysv/linux/generic/chmod.c > rename to sysdeps/unix/sysv/linux/chmod.c > index 98b72c0be1..aedd4c0aed 100644 > --- a/sysdeps/unix/sysv/linux/generic/chmod.c > +++ b/sysdeps/unix/sysv/linux/chmod.c > @@ -1,4 +1,5 @@ > -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. > +/* Change permissions of a file. 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 > @@ -16,14 +17,17 @@ > . */ > > #include > -#include > #include > > /* Change the protections of FILE to MODE. */ > int > __chmod (const char *file, mode_t mode) > { > - return INLINE_SYSCALL (fchmodat, 3, AT_FDCWD, file, mode); > +#ifdef __NR_chmod > + return INLINE_SYSCALL_CALL (chmod, file, mode); > +#else > + return INLINE_SYSCALL_CALL (fchmodat, AT_FDCWD, file, mode); > +#endif OK. > } > > libc_hidden_def (__chmod) -- Cheers, Carlos.