type exposure fixes in sys/sem.h
[musl] / include / sys / epoll.h
1 #ifndef _SYS_EPOLL_H
2 #define _SYS_EPOLL_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdint.h>
9 #include <sys/types.h>
10
11 #define __NEED_sigset_t
12
13 #include <bits/alltypes.h>
14
15 #define EPOLL_CLOEXEC 02000000
16 #define EPOLL_NONBLOCK 04000
17
18 enum EPOLL_EVENTS { __EPOLL_DUMMY };
19 #define EPOLLIN 0x001
20 #define EPOLLPRI 0x002
21 #define EPOLLOUT 0x004
22 #define EPOLLRDNORM 0x040
23 #define EPOLLRDBAND 0x080
24 #define EPOLLWRNORM 0x100
25 #define EPOLLWRBAND 0x200
26 #define EPOLLMSG 0x400
27 #define EPOLLERR 0x008
28 #define EPOLLHUP 0x010
29 #define EPOLLRDHUP 0x2000
30 #define EPOLLONESHOT (1U<<30)
31 #define EPOLLET (1U<<31)
32
33 #define EPOLL_CTL_ADD 1
34 #define EPOLL_CTL_DEL 2
35 #define EPOLL_CTL_MOD 3
36
37 typedef union epoll_data {
38         void *ptr;
39         int fd;
40         uint32_t u32;
41         uint64_t u64;
42 } epoll_data_t;
43
44 struct epoll_event {
45         uint32_t events;
46         epoll_data_t data;
47 } __attribute__ ((__packed__));
48
49
50 int epoll_create(int);
51 int epoll_create1(int);
52 int epoll_ctl(int, int, int, struct epoll_event *);
53 int epoll_wait(int, struct epoll_event *, int, int);
54 int epoll_pwait(int, struct epoll_event *, int, int, const sigset_t *);
55
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif /* sys/epoll.h */