1 /* ISC license. */
2 
3 #ifndef IOPAUSE_H
4 #define IOPAUSE_H
5 
6 #include <poll.h>
7 #include <skalibs/tai.h>
8 
9 typedef struct pollfd iopause_fd, *iopause_fd_ref ;
10 
11 #define IOPAUSE_READ (POLLIN|POLLHUP)
12 #define IOPAUSE_WRITE POLLOUT
13 #define IOPAUSE_EXCEPT (POLLERR|POLLHUP|POLLNVAL)
14 
15 typedef int iopause_func_t (iopause_fd *, unsigned int, tain_t const *, tain_t const *) ;
16 typedef iopause_func_t *iopause_func_t_ref ;
17 
18 extern iopause_func_t iopause_select ;
19 extern iopause_func_t iopause_poll ;
20 extern iopause_func_t iopause_ppoll ;
21 
22 extern iopause_func_t_ref const iopause_ ;
23 #define iopause (*iopause_)
24 
25 extern int iopause_stamp (iopause_fd *, unsigned int, tain_t const *, tain_t *) ;
26 #define iopause_g(x, n, deadline) iopause_stamp(x, n, (deadline), &STAMP)
27 
28 extern void deepsleepuntil (tain_t const *, tain_t *) ;
29 #define deepsleepuntil_g(deadline) deepsleepuntil((deadline), &STAMP)
30 
31 #endif
32