uts: make emu10k non-verbose
[unleashed.git] / include / sys / epoll.h
blobf2e4b90ab7e50395a4a39b6f27d0f49097525c45
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright (c) 2014, Joyent, Inc. All rights reserved.
16 #ifndef _SYS_EPOLL_H
17 #define _SYS_EPOLL_H
19 #include <sys/types.h>
20 #include <sys/poll.h>
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 typedef union epoll_data {
27 void *ptr;
28 int fd;
29 uint32_t u32;
30 uint64_t u64;
31 } epoll_data_t;
33 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
34 #pragma pack(4)
35 #endif
37 typedef struct epoll_event {
38 uint32_t events; /* events */
39 epoll_data_t data; /* user-specified data */
40 } epoll_event_t;
42 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
43 #pragma pack()
44 #endif
47 * Define the EPOLL* constants in terms of their poll(2)/poll(7) equivalents.
48 * Note that the values match the equivalents in Linux to allow for any binary
49 * compatibility layers to not need to translate them.
51 #define EPOLLIN 0x0001
52 #define EPOLLPRI 0x0002
53 #define EPOLLOUT 0x0004
54 #define EPOLLRDNORM 0x0040
55 #define EPOLLRDBAND 0x0080
56 #define EPOLLWRNORM 0x0100
57 #define EPOLLWRBAND 0x0200
58 #define EPOLLMSG 0x0400 /* not used */
59 #define EPOLLERR 0x0008
60 #define EPOLLHUP 0x0010
61 #define EPOLLRDHUP 0x2000
63 #define EPOLLWAKEUP (1UL << 29) /* no meaning; silently ignored */
64 #define EPOLLONESHOT (1UL << 30) /* translated to POLLONESHOT */
65 #define EPOLLET (1UL << 31) /* translated to POLLET */
67 #define EPOLL_CTL_ADD 1
68 #define EPOLL_CTL_DEL 2
69 #define EPOLL_CTL_MOD 3
71 #define EPOLL_CLOEXEC 02000000
73 #if !defined(_KERNEL)
75 extern int epoll_create(int size);
76 extern int epoll_create1(int flags);
77 extern int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
78 extern int epoll_wait(int epfd, struct epoll_event *events,
79 int maxevents, int timeout);
80 extern int epoll_pwait(int epfd, struct epoll_event *events,
81 int maxevents, int timeout, const sigset_t *sigmask);
83 #endif /* !_KERNEL */
85 #ifdef __cplusplus
87 #endif
89 #endif /* _SYS_EPOLL_H */