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.