public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/108178] Filesystem::copy_file can't copy from /proc on Linux machines Date: Mon, 19 Dec 2022 15:53:01 +0000 [thread overview] Message-ID: <bug-108178-4-IFAhf6mo8V@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108178-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108178 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- On the other hand, it's not a bug in /proc, because the size of some of those files might vary dynamically, and the size isn't known until you try to read it. So even if we got a size from stat, we might read a different number of bytes once we open it, and so sendfile wouldn't copy the whole thing anyway. And on the gripping hand, reading from /proc could be considered undefined behaviour because files that are changing while performing std::filesystem operations cause races and so the behaviour is not defined by the standard. But we can make it work in practice.
next prev parent reply other threads:[~2022-12-19 15:53 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-12-19 15:11 [Bug libstdc++/108178] New: " faivel555 at gmail dot com 2022-12-19 15:39 ` [Bug libstdc++/108178] " rguenth at gcc dot gnu.org 2022-12-19 15:47 ` redi at gcc dot gnu.org 2022-12-19 15:53 ` redi at gcc dot gnu.org [this message] 2022-12-20 12:39 ` rguenth at gcc dot gnu.org 2023-03-21 12:02 ` redi at gcc dot gnu.org 2023-03-22 12:21 ` redi at gcc dot gnu.org 2023-06-06 11:38 ` cvs-commit at gcc dot gnu.org 2023-06-06 14:10 ` cvs-commit at gcc dot gnu.org 2023-06-06 14:20 ` redi at gcc dot gnu.org 2023-10-03 16:11 ` cvs-commit at gcc dot gnu.org 2023-10-04 11:29 ` cvs-commit at gcc dot gnu.org 2023-10-04 11:34 ` 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-108178-4-IFAhf6mo8V@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: linkBe 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).