#include <sys/prctl.h>
#include <sys/sysinfo.h>
#include <unistd.h>
+#include <signal.h>
#include <fcntl.h>
#include <time.h>
QUEUE* q;
uv__io_t* w;
sigset_t sigset;
- uint64_t sigmask;
uint64_t base;
+ int is_sigmasked;
int have_signals;
int nevents;
int count;
w->events = w->pevents;
}
- sigmask = 0;
+ is_sigmasked = 0;
+ sigemptyset(&sigset);
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
- sigemptyset(&sigset);
sigaddset(&sigset, SIGPROF);
- sigmask |= 1 << (SIGPROF - 1);
+ is_sigmasked = 1;
}
assert(timeout >= -1);
if (sizeof(int32_t) == sizeof(long) && timeout >= max_safe_timeout)
timeout = max_safe_timeout;
- if (sigmask != 0 && no_epoll_pwait != 0)
+ if (is_sigmasked != 0 && no_epoll_pwait != 0)
if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
abort();
- if (no_epoll_wait != 0 || (sigmask != 0 && no_epoll_pwait == 0)) {
+ if (no_epoll_wait != 0 || (is_sigmasked != 0 && no_epoll_pwait == 0)) {
nfds = uv__epoll_pwait(loop->backend_fd,
events,
ARRAY_SIZE(events),
timeout,
- sigmask);
+ &sigset);
if (nfds == -1 && errno == ENOSYS)
no_epoll_pwait = 1;
} else {
no_epoll_wait = 1;
}
- if (sigmask != 0 && no_epoll_pwait != 0)
+ if (is_sigmasked != 0 && no_epoll_pwait != 0)
if (pthread_sigmask(SIG_UNBLOCK, &sigset, NULL))
abort();
#include "linux-syscalls.h"
#include <unistd.h>
#include <signal.h>
+#include <sys/epoll.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <errno.h>
struct uv__epoll_event* events,
int nevents,
int timeout,
- uint64_t sigmask) {
+ const sigset_t* sigmask) {
#if defined(__NR_epoll_pwait)
- int result;
- result = syscall(__NR_epoll_pwait,
- epfd,
- events,
- nevents,
- timeout,
- &sigmask,
- sizeof(sigmask));
-#if MSAN_ACTIVE
- if (result > 0)
- __msan_unpoison(events, sizeof(events[0]) * result);
-#endif
- return result;
+ return epoll_pwait(epfd,
+ (struct epoll_event *) events,
+ nevents,
+ timeout,
+ sigmask);
#else
return errno = ENOSYS, -1;
#endif
struct uv__epoll_event* events,
int nevents,
int timeout,
- uint64_t sigmask);
+ const sigset_t* sigmask);
int uv__eventfd2(unsigned int count, int flags);
int uv__inotify_init(void);
int uv__inotify_init1(int flags);