From 734c25d19a0fb9423e918fb5664362ca03f8195b Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 15 Jun 2026 20:00:56 +1200 Subject: [PATCH] Fix epoll_pwait2 feature detection The Termux Android build can expose an epoll_pwait2 symbol while omitting the corresponding declaration from . 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 https://github.com/socketry/io-event/issues/155 --- ext/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 40b5b8bf..085b609a 100755 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -55,7 +55,7 @@ have_func("&rb_process_status_wait") have_func("rb_fiber_current") have_func("&rb_fiber_raise") -have_func("epoll_pwait2") if enable_config("epoll_pwait2", true) +have_func("epoll_pwait2(0, 0, 0, 0, 0)", "sys/epoll.h") if enable_config("epoll_pwait2", true) have_header("ruby/io/buffer.h")