libstdc++: Use copy_file_range for filesystem::copy_file
copy_file_range is a recent-ish syscall for copying files. It is similar
to sendfile but allows filesystem-specific optimizations. Common are:
Reflinks: BTRFS, XFS, ZFS (does not implement the syscall yet)
Server-side copy: NFS, SMB, Ceph
If copy_file_range is not available for the given files, fall back to
sendfile / userspace copy.
libstdc++-v3/ChangeLog:
* acinclude.m4 (_GLIBCXX_USE_COPY_FILE_RANGE): Define.
* config.h.in: Regenerate.
* configure: Regenerate.
* src/filesystem/ops-common.h (copy_file_copy_file_range):
Define new function.
(do_copy_file): Use it.
Signed-off-by:
Jannik Glückert <jannik.glueckert@gmail.com>
Showing
- libstdc++-v3/acinclude.m4 20 additions, 0 deletionslibstdc++-v3/acinclude.m4
- libstdc++-v3/config.h.in 3 additions, 0 deletionslibstdc++-v3/config.h.in
- libstdc++-v3/configure 62 additions, 0 deletionslibstdc++-v3/configure
- libstdc++-v3/src/filesystem/ops-common.h 56 additions, 0 deletionslibstdc++-v3/src/filesystem/ops-common.h
Loading
Please register or sign in to comment