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 656D2386F0C9 for ; Mon, 27 Jun 2022 09:52:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 656D2386F0C9 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-9cE1AsB0Mtm6ksgVQ0OjSw-1; Mon, 27 Jun 2022 05:52:23 -0400 X-MC-Unique: 9cE1AsB0Mtm6ksgVQ0OjSw-1 Received: by mail-ed1-f70.google.com with SMTP id x21-20020a05640226d500b00435bd7f9367so6783696edd.8 for ; Mon, 27 Jun 2022 02:52:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sVl5aFqjq6MTU49X4UYyKJZQNnblwlmHYCc0avifSbw=; b=qKxasU4qIJ0MOjy1TGR+Ox2VxR+oC9W5Sk6dPLi2jyE+m3BoKxwNsDi/DwZwy6Sx2k DwMGn3hUEsXRa4NqL0nMwIZ0oHXzA0tPdpiqE70im01VRq4g+DjxefZUrOBNxR2tUz2x jpkYNb8Bawh71g0g4ON6HOc/YCnxjQ+7Cpi02H6heOdUp2EPI2LoveW2X8IgG+ZU5h8L /VN491FQSe1eIElmzMB471ooKQfS+BxxcvX/WuT+egBPTriXnyDI6xww1Q55Yv7xrdBE hKoqYEMeVrvjFcimj/BqjSs/vJShBw0xk7krGZSYc5mpidJ6FvvvIHK/ldzey8bJlKod WglQ== X-Gm-Message-State: AJIora8gPKavfjexjvhwMASwtwNn8T9rTByB5cb3GTALmBdGkbNsPYCe af+xa3y/CO+nW2ornPjbIUSbaHN913xXhqmTu/bM1P/JH/TUNH3wfv0PbjzREtkgXVwxwbRWka5 wMqK/8T1gl9mNVU9kO2p0wMYfdVUBOR0= X-Received: by 2002:a17:906:c354:b0:726:3b55:7045 with SMTP id ci20-20020a170906c35400b007263b557045mr11497355ejb.723.1656323541912; Mon, 27 Jun 2022 02:52:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tRfI4lQ22Tc3Cb/Aih9A7v1eMfFbTSQYSHfocr35nhPXUmEJUV2Tmqo57PVuNjw/NGObCt8+5KiZTI9fSuX3I= X-Received: by 2002:a17:906:c354:b0:726:3b55:7045 with SMTP id ci20-20020a170906c35400b007263b557045mr11497343ejb.723.1656323541734; Mon, 27 Jun 2022 02:52:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Mon, 27 Jun 2022 10:52:10 +0100 Message-ID: Subject: Re: [PATCH] libstdc++-v3: check for openat To: Alexandre Oliva Cc: gcc Patches , "libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 09:52:27 -0000 On Mon, 27 Jun 2022 at 10:49, Alexandre Oliva wrote: > > On Jun 24, 2022, Jonathan Wakely wrote: > > > Ah, but this patch only added the HAVE_OPENAT check to > > src/filesystem/dir.cc not the similar code in src/c++17/fs_dir.cc > > Doh! It was such a long and goof-ful day :-( > > Thanks for catching it. > > Unless you ask me not to, I'd like to install this to complete the > earlier patch. OK, although I'll just remove it again as part of the _At_path patch that makes this extra check unnecessary. But this part would be a candidate for backporting. > I've given it some testing, along with your _At_path > patch, and results are looking promising. There are still a few > remaining fails. > > > libstdc++: check for openat with dirfd in std::filesystem > > From: Alexandre Oliva > > In the recent patch to check for openat, I missed an occurrence of > dirfd in std::filesystem. > > > for libstdc++-v3/ChangeLog > > * src/c++17/fs_dir.cc (dir_and_pathname): Use dirfd if > _GLIBCXX_HAVE_OPENAT. > --- > libstdc++-v3/src/c++17/fs_dir.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc > index c67fe76bc14f8..25b33baa875fb 100644 > --- a/libstdc++-v3/src/c++17/fs_dir.cc > +++ b/libstdc++-v3/src/c++17/fs_dir.cc > @@ -124,7 +124,7 @@ struct fs::_Dir : _Dir_base > dir_and_pathname() const noexcept > { > const fs::path& p = entry.path(); > -#if _GLIBCXX_HAVE_DIRFD > +#if _GLIBCXX_HAVE_DIRFD && _GLIBCXX_HAVE_OPENAT > if (!p.empty()) > return {::dirfd(this->dirp), std::prev(p.end())->c_str()}; > #endif > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about injustice > but very few check the facts. Ask me about >