llvm-project/libcxx/test
Eric Fiselier 7c0ed44db0 Implement a better copy_file.
This patch improves both the performance, and the safety of the
copy_file implementation.

The performance improvements are achieved by using sendfile on
Linux and copyfile on OS X when available.

The TOCTOU hardening is achieved by opening the source and
destination files and then using fstat to check their attributes to
see if we can copy them.

Unfortunately for the destination file, there is no way to open
it without accidentally creating it, so we first have to use
stat to determine if it exists, and if we should copy to it.
Then, once we're sure we should try to copy, we open the dest
file and ensure it names the same entity we previously stat'ed.

llvm-svn: 337649
2018-07-22 02:00:53 +00:00
..
libcxx Fix two test failures in <experimental/filesystem> 2018-07-20 01:51:48 +00:00
std Implement a better copy_file. 2018-07-22 02:00:53 +00:00
support Implement a better copy_file. 2018-07-22 02:00:53 +00:00
CMakeLists.txt Allow passing additional compiler/linker flags for the tests 2018-02-23 15:19:48 +00:00
lit.cfg Move libcxx/test/libcxx python package into libcxx/utils/libcxx. 2017-02-09 23:18:11 +00:00
lit.site.cfg.in Allow passing additional compiler/linker flags for the tests 2018-02-23 15:19:48 +00:00
nothing_to_do.pass.cpp