summaryrefslogtreecommitdiff
path: root/src/include/skalibs/iopause.h
blob: 36521d7452520931a6ed24538e6f691bf7f1d7d6 (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
32
/* ISC license. */

#ifndef SKALIBS_IOPAUSE_H
#define SKALIBS_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 (iopause_fd *, unsigned int, tain const *, tain const *) ;
typedef iopause_func *iopause_func_ref ;

extern iopause_func iopause_select ;
extern iopause_func iopause_poll ;
extern iopause_func iopause_ppoll ;

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

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

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

#endif