Skip to content

Commit

Permalink
[ANDROID] Fix build, as epoll_pwait2 doesn't seems to exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Mar 4, 2025
1 parent 1bf4851 commit 39583c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/wrapped/wrappedlibc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39583c6

Please sign in to comment.