1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef _@GUARD_PREFIX@_POLL_H
22
23 #if __GNUC__ >= 3
24 @PRAGMA_SYSTEM_HEADER@
25 #endif
26 @PRAGMA_COLUMNS@
27
28
29 #if @HAVE_POLL_H@
30 # @INCLUDE_NEXT@ @NEXT_POLL_H@
31 #endif
32
33 #ifndef _@GUARD_PREFIX@_POLL_H
34 #define _@GUARD_PREFIX@_POLL_H
35
36
37
38
39 #if @HAVE_WINSOCK2_H@
40 # include <winsock2.h>
41 #endif
42
43
44
45
46
47
48
49 #if !@HAVE_POLL_H@
50
51 # if @HAVE_WINSOCK2_H@
52
53 # undef POLLIN
54 # undef POLLPRI
55 # undef POLLOUT
56 # undef POLLERR
57 # undef POLLHUP
58 # undef POLLNVAL
59 # undef POLLRDNORM
60 # undef POLLRDBAND
61 # undef POLLWRNORM
62 # undef POLLWRBAND
63 # define pollfd rpl_pollfd
64 # endif
65
66
67 # define POLLIN 0x0001
68 # define POLLPRI 0x0002
69 # define POLLOUT 0x0004
70 # define POLLERR 0x0008
71 # define POLLHUP 0x0010
72 # define POLLNVAL 0x0020
73 # define POLLRDNORM 0x0040
74 # define POLLRDBAND 0x0080
75 # define POLLWRNORM 0x0100
76 # define POLLWRBAND 0x0200
77
78 # if !GNULIB_defined_poll_types
79
80 struct pollfd
81 {
82 int fd;
83 short events;
84 short revents;
85 };
86
87 typedef unsigned long nfds_t;
88
89 # define GNULIB_defined_poll_types 1
90 # endif
91
92
93 # if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)
94 # define INFTIM (-1)
95 # endif
96
97 #endif
98
99
100 #if @GNULIB_POLL@
101 # if @REPLACE_POLL@
102 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
103 # undef poll
104 # define poll rpl_poll
105 # endif
106 _GL_FUNCDECL_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
107 _GL_CXXALIAS_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
108 # else
109 # if !@HAVE_POLL@
110 _GL_FUNCDECL_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
111 # endif
112 _GL_CXXALIAS_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
113 # endif
114 _GL_CXXALIASWARN (poll);
115 #elif defined GNULIB_POSIXCHECK
116 # undef poll
117 # if HAVE_RAW_DECL_POLL
118 _GL_WARN_ON_USE (poll, "poll is unportable - "
119 "use gnulib module poll for portability");
120 # endif
121 #endif
122
123
124 #endif
125 #endif