From 39583c6da4f43e63820d37c4a82ac02d95098e94 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 4 Mar 2025 14:36:25 +0100 Subject: [PATCH] [ANDROID] Fix build, as epoll_pwait2 doesn't seems to exist --- src/wrapped/wrappedlibc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 206254e51..9686de1bf 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -2203,7 +2203,18 @@ EXPORT int my_epoll_pwait2(int epfd, void* events, int maxevents, const struct t { struct epoll_event _events[maxevents]; //AlignEpollEvent(_events, events, maxevents); + #ifdef ANDROID + // epoll_pwait2 doesn't exist, to tranforming timeout to int... + int tout = -1; + if(timeout) { + int64_t tmp = timeout->tv_nsec + timeout->tv_sec*1000000000LL; + 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 if(ret>0) UnalignEpollEvent(events, _events, ret); return ret;