• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef	_POLL_H
2 #define	_POLL_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <sys/features.h>
9 
10 #include <bits/poll.h>
11 
12 #define POLLIN     0x001
13 #define POLLPRI    0x002
14 #define POLLOUT    0x004
15 #define POLLERR    0x008
16 #define POLLHUP    0x010
17 #define POLLNVAL   0x020
18 #define POLLRDNORM 0x040
19 #define POLLRDBAND 0x080
20 #ifndef POLLWRNORM
21 #define POLLWRNORM 0x100
22 #define POLLWRBAND 0x200
23 #endif
24 #ifndef POLLMSG
25 #define POLLMSG    0x400
26 #define POLLRDHUP  0x2000
27 #endif
28 
29 #define MAX_POLL_NFDS 0x1000
30 
31 typedef unsigned int pollevent_t;
32 
33 typedef unsigned long nfds_t;
34 
35 struct pollfd {
36 	int fd;
37 	short events;
38 	short revents;
39 };
40 
41 int poll (struct pollfd *, nfds_t, int);
42 
43 #ifdef _GNU_SOURCE
44 #include <sys/types.h>
45 int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
46 #endif
47 
48 #include "semaphore.h"
49 #include "linux/wait.h"
50 
51 struct tag_poll_wait_entry;
52 
53 typedef struct tag_poll_wait_entry* poll_wait_head;
54 
55 typedef struct tag_poll_table {
56   poll_wait_head wait;
57   pollevent_t key;
58 } poll_table;
59 
60 extern void notify_poll(wait_queue_head_t* wait_address);
61 extern void notify_poll_with_key(wait_queue_head_t* wait_address, pollevent_t key);
62 
63 #if _REDIR_TIME64
64 #ifdef _GNU_SOURCE
65 __REDIR(ppoll, __ppoll_time64);
66 #endif
67 #endif
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif
74