Skip to content

Commit 08ce4e2

Browse files
samuel-williams-shopifyioquatix
authored andcommitted
Fix epoll_pwait2 feature detection
The Termux Android build can expose an epoll_pwait2 symbol while omitting the corresponding declaration from <sys/epoll.h>. The previous mkmf probe only checked whether the symbol could be linked, so extconf.rb generated HAVE_EPOLL_PWAIT2 even though epoll.c could not compile a real call to the function under C99 implicit-declaration rules. Probe epoll_pwait2 using the same header and a concrete call expression instead. This keeps HAVE_EPOLL_PWAIT2 enabled on platforms where the header declares the API, while allowing Android/Termux to fall back to the existing epoll_wait path. Closes #155
1 parent a360692 commit 08ce4e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
have_func("&rb_process_status_wait")
5656
have_func("rb_fiber_current")
5757
have_func("&rb_fiber_raise")
58-
have_func("epoll_pwait2") if enable_config("epoll_pwait2", true)
58+
have_func("epoll_pwait2(0, 0, 0, 0, 0)", "sys/epoll.h") if enable_config("epoll_pwait2", true)
5959

6060
have_header("ruby/io/buffer.h")
6161

0 commit comments

Comments
 (0)