From acce4558a0168e625e9c70f20018dad6225adc0e Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Thu, 29 Aug 2024 12:58:35 +0800 Subject: [PATCH] os: update the linux minimal version and fix a typo for zero-copy Change-Id: Ia6a2768be0e044112831c278d88ff31ba3caa9f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/609298 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/os/zero_copy_freebsd.go | 2 +- src/os/zero_copy_linux.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/zero_copy_freebsd.go b/src/os/zero_copy_freebsd.go index 4751ca46be..aacfe86105 100644 --- a/src/os/zero_copy_freebsd.go +++ b/src/os/zero_copy_freebsd.go @@ -16,7 +16,7 @@ func (f *File) writeTo(w io.Writer) (written int64, handled bool, err error) { } func (f *File) readFrom(r io.Reader) (written int64, handled bool, err error) { - // copy_file_range(2) doesn't supports destinations opened with + // copy_file_range(2) doesn't support destinations opened with // O_APPEND, so don't bother to try zero-copy with these system calls. // // Visit https://man.freebsd.org/cgi/man.cgi?copy_file_range(2)#ERRORS for details. diff --git a/src/os/zero_copy_linux.go b/src/os/zero_copy_linux.go index 42e05d4e1f..0c9a8beb7e 100644 --- a/src/os/zero_copy_linux.go +++ b/src/os/zero_copy_linux.go @@ -139,7 +139,7 @@ func (f *File) copyFile(r io.Reader) (written int64, handled bool, err error) { // We can employ sendfile(2) when copy_file_range(2) fails to handle the copy. // sendfile(2) enabled file-to-file copying since Linux 2.6.33 and Go requires - // Linux 3.17 or later, so we're good to go. + // Linux 3.2 or later, so we're good to go. // Check out https://man7.org/linux/man-pages/man2/sendfile.2.html#DESCRIPTION for more details. rerr := sc.Read(func(fd uintptr) bool { written, err, handled = poll.SendFile(&f.pfd, int(fd), remain)