Implement sys::fs::copy_file using the macOS copyfile(3) API
authorAdrian Prantl <aprantl@apple.com>
Thu, 18 Apr 2019 00:01:05 +0000 (00:01 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 18 Apr 2019 00:01:05 +0000 (00:01 +0000)
commit91a06bee788262a294527b815354f380d99dfa9b
treeffc6b391d527c29d3114f02bebcb3ae4fdc417d9
parentf8268f67f562ff8fd49ddbdef0adbc44837c5406
Implement sys::fs::copy_file using the macOS copyfile(3) API
to support APFS clones.

This patch adds a Darwin-specific implementation of
llvm::sys::fs::copy_file() that uses the macOS copyfile(3) API to
support APFS copy-on-write clones, which should be faster and much
more space efficient.

https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html

Differential Revision: https://reviews.llvm.org/D60802

llvm-svn: 358628
llvm/lib/Support/Path.cpp
llvm/lib/Support/Unix/Path.inc