Commit cdab606
authored
When possible, clone files on Linux and FreeBSD. (swiftlang#1736)
* When possible, clone files on Linux and FreeBSD.
This change adds support for file cloning on Linux and FreeBSD where supported
by the underlying OS and filesystem.
I don't have a great story for unit testing here as if either call fails, we'll
fall back to block-based copying which, in the general case, will appear to the
caller like a successful copy. Furthermore, our CI systems aren't configured
with file systems that support file cloning anyway.
Resolves swiftlang#1727.
* That's not what those are called...
* FICLONE is a complex macro
* Include fs.h in the right place
* Move shims
* Remove duplicate include1 parent 4526802 commit cdab606
File tree
2 files changed
+40
-1
lines changed- Sources
- FoundationEssentials/FileManager
- _FoundationCShims/include
2 files changed
+40
-1
lines changedLines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
875 | 879 | | |
876 | 880 | | |
877 | 881 | | |
| |||
906 | 910 | | |
907 | 911 | | |
908 | 912 | | |
909 | | - | |
| 913 | + | |
910 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
911 | 932 | | |
912 | 933 | | |
913 | 934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| |||
0 commit comments