about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-03-07 10:59:44 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-03-07 10:59:44 +0100
commit401d2ae0b9e15164371e473ed89435ffdb5b0c8c (patch)
treec239b9a06d3bde854063b166af122bb4d786e566 /src
parent8dde7961034470f4fd259a673b13ecca947481f2 (diff)
downloadbox64-401d2ae0b9e15164371e473ed89435ffdb5b0c8c.tar.gz
box64-401d2ae0b9e15164371e473ed89435ffdb5b0c8c.zip
[WRAPPER] Do not reference epoll_pwait2 directly, to fix issues with Android and old glibc based system (also for #2425)
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/wrappedlibc.c26
1 files changed, 13 insertions, 13 deletions
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;