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

            Bug ID: 108178
           Summary: Filesystem::copy_file can't copy from /proc on Linux
                    machines
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: faivel555 at gmail dot com
  Target Milestone: ---

Hello,
When trying to copy a file from /proc folder on Linux, copy_file won't copy the
file but will generate a success status.

The problem is that copy_file passes 0 file size to sendfile() on Linux
machines as you can see here:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/src/filesystem/ops-common.h#L499
 
, making sendfile() to do nothing. Since most of the files if not all files in
/proc don't have a valid file size, the copying will be successful but no files
are copied.


Thanks,
Faivel

Reply via email to