]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.19] syscall, internal/poll: fall back to accept on linux-arm
authorIan Lance Taylor <iant@golang.org>
Thu, 15 Dec 2022 21:54:33 +0000 (13:54 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 21 Dec 2022 19:09:19 +0000 (19:09 +0000)
commit41eb70ae9139d48550389222302c723840c2d619
treeb66364e1be776ac4c291608a2bc3316660b73d16
parentda744b195587474281adc8f5678e61370de19fca
[release-branch.go1.19] syscall, internal/poll: fall back to accept on linux-arm

Our minimum Linux version is 2.6.32, and the accept4 system call was
introduced in 2.6.28, so we use accept4 everywhere. Unfortunately,
it turns out that the accept4 system call was only added to
linux-arm in 2.6.36, so for linux-arm only we need to try the accept4
system call and then fall back to accept if it doesn't work.

The code we use on linux-arm is the code we used in Go 1.17.
On non-arm platforms we continue using the simpler code introduced
in Go 1.18.

Adding accept4 to the ARM Linux kernel was:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=21d93e2e29722d7832f61cc56d73fb953ee6578e

For #57333
Fixes #57339

Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d
Reviewed-on: https://go-review.googlesource.com/c/go/+/457996
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/internal/poll/sock_cloexec.go
src/internal/poll/sock_cloexec_accept.go [new file with mode: 0644]
src/syscall/syscall_linux.go
src/syscall/syscall_linux_accept.go [new file with mode: 0644]
src/syscall/syscall_linux_accept4.go [new file with mode: 0644]
src/syscall/zsyscall_linux_arm.go