diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-03-04 14:36:25 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-03-04 14:36:25 +0100 |
| commit | 39583c6da4f43e63820d37c4a82ac02d95098e94 (patch) | |
| tree | 7b7edfb2f8a4754d2b170bffc55c450dfdba2768 /src | |
| parent | 1bf4851cf6f3a97098d9e9ce9f51b4815eb7fd89 (diff) | |
| download | box64-39583c6da4f43e63820d37c4a82ac02d95098e94.tar.gz box64-39583c6da4f43e63820d37c4a82ac02d95098e94.zip | |
[ANDROID] Fix build, as epoll_pwait2 doesn't seems to exist
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 206254e5..9686de1b 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; |