Skip to content
Snippets Groups Projects
Commit 07a0e108 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

libstdc++: Make std::filesystem::copy_file work for procfs [PR108178]

The size reported by stat is always zero for some special files such as
those under /proc, which means the current copy_file implementation
thinks there is nothing to copy. Instead of trusting the stat value, try
to read a character from a streambuf and check for EOF.

libstdc++-v3/ChangeLog:

	PR libstdc++/108178
	* src/filesystem/ops-common.h (do_copy_file): Check for empty
	files by trying to read a character.
	* testsuite/27_io/filesystem/operations/copy_file_108178.cc:
	New test.
parent d87caacf
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment