1
0
mirror of https://github.com/golang/go synced 2024-11-13 12:50:44 -07:00

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 <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Andy Pan 2024-08-29 12:58:35 +08:00 committed by Gopher Robot
parent d555358bf8
commit acce4558a0
2 changed files with 2 additions and 2 deletions

View File

@ -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.

View File

@ -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)