riscv32: add setjmp/longjmp and sigreturn
[musl.git] / src / select / poll.c
blob7883dfab478a25e15b973ea750f3f373214bac15
1 #include <poll.h>
2 #include <time.h>
3 #include <signal.h>
4 #include "syscall.h"
6 int poll(struct pollfd *fds, nfds_t n, int timeout)
8 #ifdef SYS_poll
9 return syscall_cp(SYS_poll, fds, n, timeout);
10 #else
11 #if SYS_ppoll_time64 == SYS_ppoll
12 typedef long long ppoll_ts_t[2];
13 #else
14 typedef long ppoll_ts_t[2];
15 #endif
16 return syscall_cp(SYS_ppoll, fds, n, timeout>=0 ?
17 ((ppoll_ts_t){ timeout/1000, timeout%1000*1000000 }) : 0,
18 0, _NSIG/8);
19 #endif