public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lennoxhoe at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/113663] New: [MinGW] std::filesystem::hard_link_count always returns 1
Date: Mon, 29 Jan 2024 18:18:07 +0000	[thread overview]
Message-ID: <bug-113663-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113663

            Bug ID: 113663
           Summary: [MinGW] std::filesystem::hard_link_count always
                    returns 1
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lennoxhoe at gmail dot com
  Target Milestone: ---

Hello!

std::filesystem::hard_link_count() appears to always return 1 when built with
gcc-13.2.0 + mingw-w64ucrt-11.0.1-r3 on Windows 10 19045

Stepping through with a debugger, it looks like hard_link_count() queries
Windows'  _wstat64() for this information.

The MSFT documentation claims this is the expected behaviour for non-NTFS
volumes
https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/14h5k7ff(v=vs.120)

However, in my tests both the links are located on the same NTFS volume.
Furthermore, GetFileInformationByHandle does return the correct result of 2.

There appears to be some precedence in calling GetFileInformationByHandle as
seen in std::filesystem::equivalent.
Can hard_link_count() receive the same treatment?

Thanks

             reply	other threads:[~2024-01-29 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 18:18 lennoxhoe at gmail dot com [this message]
2024-01-29 18:47 ` [Bug libstdc++/113663] " lennoxhoe at gmail dot com
2024-01-29 23:38 ` lennoxhoe at gmail dot com
2024-01-30  5:16 ` xry111 at gcc dot gnu.org
2024-01-30 11:59 ` redi at gcc dot gnu.org
2024-01-30 18:51 ` lennoxhoe at gmail dot com
2024-03-27 17:49 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113663-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).