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.2 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 4370C1F601 for ; Mon, 5 Dec 2022 16:40:21 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="H9dYuAoG"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 797B73948A5E for ; Mon, 5 Dec 2022 16:40:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 797B73948A5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670258420; bh=cITtfmwqZoN7zG6ZxoKP7/4yxhjDRl1wJ5SwCdz9uns=; 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=H9dYuAoG357vRNAJlG45ywIT30s82rlNl9sQj2PAq0MFFI8McnUUNh8Wt3B1QlnJv 7olQFEWPVUdqg54bEaUBRfRCWmDXXO5pTOLFBitokSARKtejuiegKQPWM5LRxxmzw8 o7ZeYEIWnsVfXjViwrrvHejAiLxUTkwMnYYmp6M0= 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 0BB37394201B for ; Mon, 5 Dec 2022 16:39:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0BB37394201B Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-267-EkCsJhy3MFy0v9Zn4xTvaQ-1; Mon, 05 Dec 2022 11:39:51 -0500 X-MC-Unique: EkCsJhy3MFy0v9Zn4xTvaQ-1 Received: by mail-il1-f200.google.com with SMTP id o10-20020a056e02102a00b003006328df7bso12581960ilj.17 for ; Mon, 05 Dec 2022 08:39:51 -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=cITtfmwqZoN7zG6ZxoKP7/4yxhjDRl1wJ5SwCdz9uns=; b=NwZnPzVX1wYYpkYNE41j8uulZjIYaiSKXrGgvlZMk6zmpRYrE9AvhTSp4oMnUpPvw9 2MkvZliRO7bSd0LMgBVX+uUnMqEygR+u5tpTRpsp16q5WQQ2Te6cB5C52bMuuqNvlDDi gszAy43QYw+1Xk92yHG0Wgp/WEX1YGUwB0wXkVp62CIn7sIETOz8L/9Nc9AzuPcrRLfC F5YLhZXlzOrh8Ul8vcsg5Df58pYuUXopXJypSsB47aAnKgKeP/NLHMzPNTko38TmC+zf j8wqAueZ54EjH2OgwxVeHVv9Gf2nxeLZCXwPteJWwBs8l9kpbfFPD3maA4WV9r+oZTF9 /KmA== X-Gm-Message-State: ANoB5pkl9MYFvH505Fgd9QU3zJLZqaw4eG7uDuhvacoCIao+Aso5TtTo 84fLUuH0Q7GHsV7/Vf9b+r88yH3pbR2PtZjztH415UXj9+gohc1C3lQvDJQN5R0INbMsY4fWhUP rVP+XiMZpr2shygtaB8Tv X-Received: by 2002:a02:956c:0:b0:363:b2f7:64d9 with SMTP id y99-20020a02956c000000b00363b2f764d9mr38121082jah.211.1670258390790; Mon, 05 Dec 2022 08:39:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6tdMDHyAfJlprUh3iO9OcsS4bZC1GneEiRjiKObdJ3KiJBPbiO21lOPXv/W4zmtBnIoaQWbw== X-Received: by 2002:a02:956c:0:b0:363:b2f7:64d9 with SMTP id y99-20020a02956c000000b00363b2f764d9mr38121075jah.211.1670258390550; Mon, 05 Dec 2022 08:39:50 -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 m16-20020a0566022e9000b006dfbfec899esm6006863iow.28.2022.12.05.08.39.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 08:39:50 -0800 (PST) Message-ID: <2caca979-a441-f903-7ce2-ee7e2ba0c908@redhat.com> Date: Mon, 5 Dec 2022 11:39:49 -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 12/30] Linux: consolidate rmdir implementation To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-13-adhemerval.zanella@linaro.org> Organization: Red Hat In-Reply-To: <20221019221433.1082017-13-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 rmdir 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 => }/rmdir.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > rename sysdeps/unix/sysv/linux/{generic => }/rmdir.c (78%) > > diff --git a/sysdeps/unix/sysv/linux/generic/rmdir.c b/sysdeps/unix/sysv/linux/rmdir.c > similarity index 78% > rename from sysdeps/unix/sysv/linux/generic/rmdir.c > rename to sysdeps/unix/sysv/linux/rmdir.c > index 214ddc711b..cd5674f07c 100644 > --- a/sysdeps/unix/sysv/linux/generic/rmdir.c > +++ b/sysdeps/unix/sysv/linux/rmdir.c > @@ -1,4 +1,5 @@ > -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. > +/* Delete a directory. 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 > __rmdir (const char *path) > { > - return INLINE_SYSCALL (unlinkat, 3, AT_FDCWD, path, AT_REMOVEDIR); > +#ifdef __NR_rmdir > + return INLINE_SYSCALL_CALL (rmdir, path); > +#else > + return INLINE_SYSCALL_CALL (unlinkat, AT_FDCWD, path, AT_REMOVEDIR); > +#endif OK. > } > weak_alias (__rmdir, rmdir) -- Cheers, Carlos.