OLD | NEW |
1 #ifndef»_POLL_H | 1 #ifndef _POLL_H |
2 #define»_POLL_H | 2 #define _POLL_H |
3 | 3 |
4 #ifdef __cplusplus | 4 #ifdef __cplusplus |
5 extern "C" { | 5 extern "C" { |
6 #endif | 6 #endif |
7 | 7 |
8 #include <features.h> | 8 #include <features.h> |
9 | 9 |
10 #include <bits/poll.h> | 10 #include <bits/poll.h> |
11 | 11 |
12 #define POLLIN 0x001 | 12 #define POLLIN 0x001 |
13 #define POLLPRI 0x002 | 13 #define POLLPRI 0x002 |
14 #define POLLOUT 0x004 | 14 #define POLLOUT 0x004 |
15 #define POLLERR 0x008 | 15 #define POLLERR 0x008 |
16 #define POLLHUP 0x010 | 16 #define POLLHUP 0x010 |
17 #define POLLNVAL 0x020 | 17 #define POLLNVAL 0x020 |
18 #define POLLRDNORM 0x040 | 18 #define POLLRDNORM 0x040 |
19 #define POLLRDBAND 0x080 | 19 #define POLLRDBAND 0x080 |
20 #ifndef POLLWRNORM | 20 #ifndef POLLWRNORM |
21 #define POLLWRNORM 0x100 | 21 #define POLLWRNORM 0x100 |
22 #define POLLWRBAND 0x200 | 22 #define POLLWRBAND 0x200 |
23 #endif | 23 #endif |
24 #ifndef POLLMSG | 24 #ifndef POLLMSG |
25 #define POLLMSG 0x400 | 25 #define POLLMSG 0x400 |
26 #define POLLRDHUP 0x2000 | 26 #define POLLRDHUP 0x2000 |
27 #endif | 27 #endif |
28 | 28 |
29 typedef unsigned long nfds_t; | 29 typedef unsigned long nfds_t; |
30 | 30 |
31 struct pollfd | 31 struct pollfd { |
32 { | 32 int fd; |
33 » int fd; | 33 short events; |
34 » short events; | 34 short revents; |
35 » short revents; | |
36 }; | 35 }; |
37 | 36 |
38 int poll (struct pollfd *, nfds_t, int); | 37 int poll(struct pollfd*, nfds_t, int); |
39 | 38 |
40 #ifdef _GNU_SOURCE | 39 #ifdef _GNU_SOURCE |
41 #define __NEED_time_t | 40 #define __NEED_time_t |
42 #define __NEED_struct_timespec | 41 #define __NEED_struct_timespec |
43 #define __NEED_sigset_t | 42 #define __NEED_sigset_t |
44 #include <bits/alltypes.h> | 43 #include <bits/alltypes.h> |
45 int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); | 44 int ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*); |
46 #endif | 45 #endif |
47 | 46 |
48 #ifdef __cplusplus | 47 #ifdef __cplusplus |
49 } | 48 } |
50 #endif | 49 #endif |
51 | 50 |
52 #endif | 51 #endif |
OLD | NEW |