Skip to content

Commit

Permalink
Added simple implementation of epoll_pwait
Browse files Browse the repository at this point in the history
Golang 1.10.x started using epoll_pwait instead of regular
epoll_wait and the golang-httpserver app does not work anymore.
This patch adds basic implementation of epoll_pwait that returns
error if non-null sigmask was passed otherwise delegates to
epoll_wait.

Signed-off-by: Waldemar Kozaczuk <[email protected]>
  • Loading branch information
wkozaczuk committed May 21, 2018
1 parent a6b3729 commit d76e530
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,17 @@ static int pselect6(int nfds, fd_set *readfds, fd_set *writefds,
return pselect(nfds, readfds, writefds, exceptfds, timeout_ts, NULL);
}

static int epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
int timeout_ms, void *sig)
{
if(sig) {
WARN_ONCE("epoll_pwait(): unimplemented with not-null sigmask\n");
errno = ENOSYS;
return -1;
}

return epoll_wait(epfd, events, maxevents, timeout_ms);
}

long syscall(long number, ...)
{
Expand Down Expand Up @@ -405,6 +416,7 @@ long syscall(long number, ...)
SYSCALL4(pread64, int, void *, size_t, off_t);
SYSCALL2(ftruncate, int, off_t);
SYSCALL1(fsync, int);
SYSCALL5(epoll_pwait, int, struct epoll_event *, int, int, void*);
}

debug_always("syscall(): unimplemented system call %d\n", number);
Expand Down

0 comments on commit d76e530

Please sign in to comment.