RFC: copy_file_range(3)
Alan Somers
asomers at freebsd.org
Sun Sep 20 15:45:47 UTC 2020
copy_file_range(2) is nifty, but it has a few sharp edges:
1) Certain file systems don't support it, necessitating a write/read based
fallback
2) It doesn't handle sparse files as well as SEEK_HOLE/SEEK_DATA
3) It's slightly tricky to both efficiently deal with holes and also
promptly respond to signals
These problems aren't terribly hard, but it seems to me like most
applications that use copy_file_range would share the exact same
solutions. In particular, I'm thinking about cp(1), dd(1), and
install(8). Those three could benefit from sharing a userland wrapper that
handles the above problems.
Should we add such a wrapper to libc? If so, what should it be called, and
should it be public or just private to /usr/src ?
-Alan
More information about the freebsd-hackers
mailing list