7 #define IS32BIT(x) !((x)+0x80000000ULL>>32)
8 #define CLAMP(x) (int)(IS32BIT(x) ? (x) : 0x7fffffffU+((0ULL+(x))>>63))
10 int ppoll(struct pollfd *fds, nfds_t n, const struct timespec *to, const sigset_t *mask)
12 time_t s = to ? to->tv_sec : 0;
13 long ns = to ? to->tv_nsec : 0;
14 #ifdef SYS_ppoll_time64
16 if (SYS_ppoll == SYS_ppoll_time64 || !IS32BIT(s))
17 r = __syscall_cp(SYS_ppoll_time64, fds, n,
18 to ? ((long long[]){s, ns}) : 0,
20 if (SYS_ppoll == SYS_ppoll_time64 || r != -ENOSYS)
21 return __syscall_ret(r);
24 return syscall_cp(SYS_ppoll, fds, n,
25 to ? ((long[]){s, ns}) : 0, mask, _NSIG/8);