[php-src] PR #23825: Fall back to epoll_wait when epoll_pwait2 is unavailable at runtime
| From: | bukka | Date: | Mon, 21 Sep 2026 15:47:34 +0000 |
| Subject: | [php-src] PR #23825: Fall back to epoll_wait when epoll_pwait2 is unavailable at runtime | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38683@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23825
Author: bukka
HAVE_EPOLL_PWAIT2 only means the libc exports the wrapper, which glibc does since 2.35
regardless of the running kernel. A PHP built on a kernel with epoll_pwait2 and run on
one older than 5.11 gets ENOSYS from every Context::wait(), which makes
the epoll backend and thus Backend::Auto unusable. This is the normal shape for Docker
images, distro packages and static builds, and it also happens under emulation layers that lack the
syscall, as seen in #23478.
Try epoll_pwait2 first and on ENOSYS or ENOTSUP switch the
process to epoll_wait, retrying the current call so the caller never sees the error.
The flag is process-wide and atomic so ZTS builds do not race on it.
The configure check is unchanged, so the plain link check keeps working when cross-compiling.
Alternative to #23478.