summaryrefslogtreecommitdiff
path: root/src/include/skalibs/iopause.h
blob: 8c8fddcf88861589abc17f22dc538f4b86f1f250 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ISC license. */

#ifndef IOPAUSE_H
#define IOPAUSE_H

#include <poll.h>
#include <skalibs/tai.h>

typedef struct pollfd iopause_fd, *iopause_fd_ref ;

#define IOPAUSE_READ (POLLIN|POLLHUP)
#define IOPAUSE_WRITE POLLOUT
#define IOPAUSE_EXCEPT (POLLERR|POLLHUP|POLLNVAL)

typedef int iopause_func_t (iopause_fd *, unsigned int, tain_t const *, tain_t const *) ;
typedef iopause_func_t *iopause_func_t_ref ;

extern iopause_func_t iopause_select ;
extern iopause_func_t iopause_poll ;
extern iopause_func_t iopause_ppoll ;

extern iopause_func_t_ref const iopause_ ;
#define iopause (*iopause_)

extern int iopause_stamp (iopause_fd *, unsigned int, tain_t const *, tain_t *) ;
#define iopause_g(x, n, deadline) iopause_stamp(x, n, (deadline), &STAMP)

extern void deepsleepuntil (tain_t const *, tain_t *) ;
#define deepsleepuntil_g(deadline) deepsleepuntil((deadline), &STAMP)

#endif