]> Cypherpunks repositories - gostls13.git/commit
internal,os: employ copy_file_range(2) for file-to-file copying on FreeBSD
authorAndy Pan <i@andypan.me>
Sat, 10 Aug 2024 03:26:02 +0000 (11:26 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 15 Aug 2024 19:23:02 +0000 (19:23 +0000)
commitf7cdadafbee0c7d78fcfd6c5281a82c6c7ac2a50
tree76c5707803833139e186f06a4e903b1b32791dab
parent2693f77b3583585172810427e12a634b28d34493
internal,os: employ copy_file_range(2) for file-to-file copying on FreeBSD

FreeBSD 13.0 introduced the Linux-compatible copy_file_range(2) system call,
we should make use of it.

Ref:
https://www.gnu.org/software/gnulib/manual/html_node/copy_005ffile_005frange.html
https://reviews.freebsd.org/D20584?id=60021
https://man.freebsd.org/cgi/man.cgi?copy_file_range(2)

Change-Id: I75edb5629717289c8887be436613d3a8b3820bdc
Reviewed-on: https://go-review.googlesource.com/c/go/+/604655
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
14 files changed:
src/internal/poll/copy_file_range_freebsd.go [new file with mode: 0644]
src/internal/poll/copy_file_range_linux.go
src/internal/poll/copy_file_range_unix.go [new file with mode: 0644]
src/internal/syscall/unix/copy_file_range_unix.go [moved from src/internal/syscall/unix/copy_file_range_linux.go with 95% similarity]
src/internal/syscall/unix/kernel_version_freebsd.go [new file with mode: 0644]
src/internal/syscall/unix/kernel_version_freebsd_test.go [new file with mode: 0644]
src/internal/syscall/unix/kernel_version_linux.go
src/internal/syscall/unix/kernel_version_other.go
src/internal/syscall/unix/sysnum_freebsd.go [new file with mode: 0644]
src/os/export_freebsd_test.go [new file with mode: 0644]
src/os/readfrom_freebsd_test.go [new file with mode: 0644]
src/os/readfrom_unix_test.go
src/os/zero_copy_freebsd.go [new file with mode: 0644]
src/os/zero_copy_stub.go