SIGN IN SIGN UP

unix: use epoll_pwait rather than epoll_wait

This extends a pattern implemented on arm64 by CL 21971
to all arches.

This is safe to do because epoll_pwait was added in Linux 2.6.19
and x/sys's go.mod file sets go 1.25.0 which has a minimum Linux
version of 3.2.

epoll_wait is a legacy syscall that is being left behind
- some newer arches (like arm64) do not implement it
- libc implementations never call it
- seccomp allow lists do not include it

epoll_pwait is a complete superset of epoll_wait: it adds a new
sigmask argument, but according to the docs:

  The sigmask argument may be specified as NULL, in which
  case epoll_pwait() is equivalent to epoll_wait().

This might have the inverse downside where someone wrote a seccomp
filter allowing epoll_wait but not epoll_pwait, but given that the
rest of the ecosystem (libcs, ...) uses epoll_pwait this seems
unlikely.

Fixes golang/go#80080

Change-Id: Ief3b7799e35c61cec328c328422155a29fc02ae4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/792700
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
J
Jorropo committed
f6fb8a1e42b1731ca8f87ace29c3307429ecdb5a
Parent: f3eeabf
Committed by Gopher Robot <gobot@golang.org> on 6/24/2026, 9:40:39 PM