Commit 04d1b82
committed
Fall back to epoll_wait when epoll_pwait2 is unavailable at runtime
HAVE_EPOLL_PWAIT2 only tells whether 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() call, which makes the epoll backend and thus the
Auto backend unusable. The same happens under emulation layers that do
not implement the syscall.
Try epoll_pwait2 first and on ENOSYS or ENOTSUP switch the process to
epoll_wait with a millisecond timeout, retrying the current call so the
failure is never visible to the caller. The flag is process wide since
kernel support is the same for every thread, and it is atomic so the
first concurrent waits in a ZTS build do not race on it.1 parent 04066f5 commit 04d1b82
1 file changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
189 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
190 | 203 | | |
191 | 204 | | |
192 | 205 | | |
| |||
0 commit comments