From 401d2ae0b9e15164371e473ed89435ffdb5b0c8c Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 7 Mar 2025 10:59:44 +0100 Subject: [WRAPPER] Do not reference epoll_pwait2 directly, to fix issues with Android and old glibc based system (also for #2425) --- src/wrapped/wrappedlibc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 9a2dd8bf..566c274a 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -2199,22 +2199,22 @@ EXPORT int32_t my_epoll_pwait(x64emu_t* emu, int32_t epfd, void* events, int32_t UnalignEpollEvent(events, _events, ret); return ret; } -EXPORT int my_epoll_pwait2(int epfd, void* events, int maxevents, const struct timespec *timeout, const sigset_t * sigmask) +EXPORT int my_epoll_pwait2(int epfd, void* events, int maxevents, struct timespec *timeout, sigset_t * sigmask) { struct epoll_event _events[maxevents]; //AlignEpollEvent(_events, events, maxevents); - #if defined(ANDROID) || defined(LA64_ABI_1) - // epoll_pwait2 doesn't exist, to tranforming timeout to int, and from nanosecods to milliseconds... - int tout = -1; - if(timeout) { - int64_t tmp = (timeout->tv_nsec + timeout->tv_sec*1000000000LL)/1000000LL; - if(tmp>1<<31) tmp = 1<<31; - tout = tmp; - } - int32_t ret = epoll_pwait(epfd, events?_events:NULL, maxevents, tout, sigmask); - #else - int32_t ret = epoll_pwait2(epfd, events?_events:NULL, maxevents, timeout, sigmask); - #endif + int ret = 0; + if(!my->epoll_pwait2) { + // epoll_pwait2 doesn't exist, to tranforming timeout to int, and from nanosecods to milliseconds... + int tout = -1; + if(timeout) { + int64_t tmp = (timeout->tv_nsec + timeout->tv_sec*1000000000LL)/1000000LL; + if(tmp>1<<31) tmp = 1<<31; + tout = tmp; + } + ret = epoll_pwait(epfd, events?_events:NULL, maxevents, tout, sigmask); + } else + ret = my->epoll_pwait2(epfd, events?_events:NULL, maxevents, timeout, sigmask); if(ret>0) UnalignEpollEvent(events, _events, ret); return ret; -- cgit 1.4.1