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.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 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=1670258392; 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=cITtfmwqZoN7zG6ZxoKP7/4yxhjDRl1wJ5SwCdz9uns=; b=OM/TNZovhgcrg2A7MDSOq1yq/8Mmeva5On+7wd27CXf8FSpzD705doTvvIsYnLR1HGxghY stqfVtYZ7hQj67T09MO4eq7/xrYaq1Wag1pvAMhqetdA4iSTbuDVYIFfM251NR0e9NYjVk rKAm9BbShO92GINRFIHFwHdIhK9NXBI= 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> From: Carlos O'Donell 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-Spam-Status: No, score=-12.6 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 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.