]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] 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:08:36 +0000 (19:08 +0000)
commit856ec21021a78faa48dfa7688840d8013279a947
tree5830f323a2a1fca5d6b5be279b14e6dec308f85e
parente6adccb3c56385f8d840165008f2606098e13e56
[release-branch.go1.18] 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 #57338

Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d
Reviewed-on: https://go-review.googlesource.com/c/go/+/457997
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@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]