Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-branch.go1.19] syscall, internal/poll: fall back to accept on linux-arm #37

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

bradfitz
Copy link
Member

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 golang#57333
Fixes golang#57339

Cherry picked from commit 8d809f950986db3162ec62aa9ebb490a2d20f621 at https://go-review.googlesource.com/c/go/+/457996 which is due to be merged into Go's release-branch.go1.19.

Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d

…n 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 golang#57333
Fixes golang#57339

Cherry picked from commit 8d809f950986db3162ec62aa9ebb490a2d20f621
at https://go-review.googlesource.com/c/go/+/457996 which is due
to be merged into Go's release-branch.go1.19.

Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d
@bradfitz
Copy link
Member Author

For tailscale/tailscale#6792

@bradfitz bradfitz requested a review from andrew-d December 19, 2022 21:48
// Handle that case here, by using a copy of the Accept function that
// we used in Go 1.17.

//go:build linux && arm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will end up building for Android as well. This should be fine, since Go 1.17 built this for Android and it worked back then.

Copy link
Member

@andrew-d andrew-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM since the upstream patchset looks like it's ready to merge.

@bradfitz bradfitz merged commit dc0ce63 into tailscale.go1.19 Dec 20, 2022
@bradfitz bradfitz deleted the bradfitz/accept4 branch December 20, 2022 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants