]> Cypherpunks repositories - gostls13.git/commit
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>
Fri, 16 Dec 2022 03:40:42 +0000 (03:40 +0000)
commit24ac659a395b2ef6c3877e82de15bed8e13fa40a
treed7c15cf23091d511423ac7fe675fdc0066c1ffba
parent3323dab1f45bbad1033cdd0c2fbfb9884c5d54cc
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

Fixes #57333

Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d
Reviewed-on: https://go-review.googlesource.com/c/go/+/457995
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@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