This source file includes following definitions.
- rpl_fd_isset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 # if __GNUC__ >= 3
18 @PRAGMA_SYSTEM_HEADER@
19 # endif
20 @PRAGMA_COLUMNS@
21
22
23
24
25
26 #if (@HAVE_SYS_SELECT_H@ \
27 && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H \
28 && ((defined __osf__ && defined _SYS_TYPES_H_ \
29 && defined _OSF_SOURCE) \
30 || (defined __sun && defined _SYS_TYPES_H \
31 && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
32 || defined __EXTENSIONS__))))
33
34 # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
35 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
36
37 #elif (@HAVE_SYS_SELECT_H@ \
38 && (defined _CYGWIN_SYS_TIME_H \
39 || (!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \
40 && ((defined __osf__ && defined _SYS_TIME_H_ \
41 && defined _OSF_SOURCE) \
42 || (defined __OpenBSD__ && defined _SYS_TIME_H_) \
43 || (defined __sun && defined _SYS_TIME_H \
44 && (! (defined _XOPEN_SOURCE \
45 || defined _POSIX_C_SOURCE) \
46 || defined __EXTENSIONS__))))))
47
48 # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
49 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
50
51
52
53
54
55
56 #elif @HAVE_SYS_SELECT_H@ && defined __sgi && (defined _SYS_BSD_TYPES_H && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H)
57
58 # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H
59 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
60
61
62
63
64
65
66 #elif @HAVE_SYS_SELECT_H@ && defined __OpenBSD__ && (defined _PTHREAD_H_ && !defined PTHREAD_MUTEX_INITIALIZER)
67
68 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
69
70 #else
71
72 #ifndef _@GUARD_PREFIX@_SYS_SELECT_H
73
74
75
76
77 #include <sys/types.h>
78
79 #if @HAVE_SYS_SELECT_H@
80
81
82
83
84
85
86
87
88 # if !(defined __GLIBC__ || defined __FreeBSD__ || defined __CYGWIN__)
89 # include <sys/time.h>
90 # endif
91
92
93
94
95 # if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ || defined __BEOS__) \
96 && ! defined __GLIBC__
97 # include <string.h>
98 # endif
99
100
101 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
102
103 #endif
104
105
106
107
108
109
110
111
112
113
114
115
116 #if !((defined __GLIBC__ || defined __CYGWIN__ || defined __KLIBC__) \
117 && !defined __UCLIBC__)
118 # include <signal.h>
119 #endif
120
121 #ifndef _@GUARD_PREFIX@_SYS_SELECT_H
122 #define _@GUARD_PREFIX@_SYS_SELECT_H
123
124 #if !@HAVE_SYS_SELECT_H@
125
126
127
128 # include <sys/time.h>
129
130
131 # if defined __hpux
132 # include <string.h>
133 # endif
134
135
136
137 # if @HAVE_WINSOCK2_H@
138 # if !defined _GL_INCLUDING_WINSOCK2_H
139 # define _GL_INCLUDING_WINSOCK2_H
140 # include <winsock2.h>
141 # undef _GL_INCLUDING_WINSOCK2_H
142 # endif
143 # include <io.h>
144 # endif
145 #endif
146
147
148
149
150
151
152
153
154 #if @HAVE_WINSOCK2_H@
155
156 # if !GNULIB_defined_rpl_fd_isset
157
158
159
160 static int
161 rpl_fd_isset (SOCKET fd, fd_set * set)
162 {
163 u_int i;
164 if (set == NULL)
165 return 0;
166
167 for (i = 0; i < set->fd_count; i++)
168 if (set->fd_array[i] == fd)
169 return 1;
170
171 return 0;
172 }
173
174 # define GNULIB_defined_rpl_fd_isset 1
175 # endif
176
177 # undef FD_ISSET
178 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
179
180 #endif
181
182
183
184 #if @HAVE_WINSOCK2_H@
185 # if !defined _@GUARD_PREFIX@_UNISTD_H
186 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
187 # undef close
188 # define close close_used_without_including_unistd_h
189 # elif !defined __clang__
190 _GL_WARN_ON_USE (close,
191 "close() used without including <unistd.h>");
192 # endif
193 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
194 # undef gethostname
195 # define gethostname gethostname_used_without_including_unistd_h
196 # elif !defined __clang__
197 _GL_WARN_ON_USE (gethostname,
198 "gethostname() used without including <unistd.h>");
199 # endif
200 # endif
201 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
202 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
203 # undef socket
204 # define socket socket_used_without_including_sys_socket_h
205 # undef connect
206 # define connect connect_used_without_including_sys_socket_h
207 # undef accept
208 # define accept accept_used_without_including_sys_socket_h
209 # undef bind
210 # define bind bind_used_without_including_sys_socket_h
211 # undef getpeername
212 # define getpeername getpeername_used_without_including_sys_socket_h
213 # undef getsockname
214 # define getsockname getsockname_used_without_including_sys_socket_h
215 # undef getsockopt
216 # define getsockopt getsockopt_used_without_including_sys_socket_h
217 # undef listen
218 # define listen listen_used_without_including_sys_socket_h
219 # undef recv
220 # define recv recv_used_without_including_sys_socket_h
221 # undef send
222 # define send send_used_without_including_sys_socket_h
223 # undef recvfrom
224 # define recvfrom recvfrom_used_without_including_sys_socket_h
225 # undef sendto
226 # define sendto sendto_used_without_including_sys_socket_h
227 # undef setsockopt
228 # define setsockopt setsockopt_used_without_including_sys_socket_h
229 # undef shutdown
230 # define shutdown shutdown_used_without_including_sys_socket_h
231 # elif !defined __clang__
232 _GL_WARN_ON_USE (socket,
233 "socket() used without including <sys/socket.h>");
234 _GL_WARN_ON_USE (connect,
235 "connect() used without including <sys/socket.h>");
236 _GL_WARN_ON_USE (accept,
237 "accept() used without including <sys/socket.h>");
238 _GL_WARN_ON_USE (bind,
239 "bind() used without including <sys/socket.h>");
240 _GL_WARN_ON_USE (getpeername,
241 "getpeername() used without including <sys/socket.h>");
242 _GL_WARN_ON_USE (getsockname,
243 "getsockname() used without including <sys/socket.h>");
244 _GL_WARN_ON_USE (getsockopt,
245 "getsockopt() used without including <sys/socket.h>");
246 _GL_WARN_ON_USE (listen,
247 "listen() used without including <sys/socket.h>");
248 _GL_WARN_ON_USE (recv,
249 "recv() used without including <sys/socket.h>");
250 _GL_WARN_ON_USE (send,
251 "send() used without including <sys/socket.h>");
252 _GL_WARN_ON_USE (recvfrom,
253 "recvfrom() used without including <sys/socket.h>");
254 _GL_WARN_ON_USE (sendto,
255 "sendto() used without including <sys/socket.h>");
256 _GL_WARN_ON_USE (setsockopt,
257 "setsockopt() used without including <sys/socket.h>");
258 _GL_WARN_ON_USE (shutdown,
259 "shutdown() used without including <sys/socket.h>");
260 # endif
261 # endif
262 #endif
263
264
265 #if @GNULIB_PSELECT@
266 # if @REPLACE_PSELECT@
267 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
268 # undef pselect
269 # define pselect rpl_pselect
270 # endif
271 _GL_FUNCDECL_RPL (pselect, int,
272 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
273 struct timespec const *restrict, const sigset_t *restrict));
274 _GL_CXXALIAS_RPL (pselect, int,
275 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
276 struct timespec const *restrict, const sigset_t *restrict));
277 # else
278 # if !@HAVE_PSELECT@
279 _GL_FUNCDECL_SYS (pselect, int,
280 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
281 struct timespec const *restrict, const sigset_t *restrict));
282 # endif
283
284
285 _GL_CXXALIAS_SYS_CAST (pselect, int,
286 (int,
287 fd_set *restrict, fd_set *restrict, fd_set *restrict,
288 struct timespec const *restrict,
289 const sigset_t *restrict));
290 # endif
291 # if __GLIBC__ >= 2
292 _GL_CXXALIASWARN (pselect);
293 # endif
294 #elif defined GNULIB_POSIXCHECK
295 # undef pselect
296 # if HAVE_RAW_DECL_PSELECT
297 _GL_WARN_ON_USE (pselect, "pselect is not portable - "
298 "use gnulib module pselect for portability");
299 # endif
300 #endif
301
302 #if @GNULIB_SELECT@
303 # if @REPLACE_SELECT@
304 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
305 # undef select
306 # define select rpl_select
307 # endif
308 _GL_FUNCDECL_RPL (select, int,
309 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
310 struct timeval *restrict));
311 _GL_CXXALIAS_RPL (select, int,
312 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
313 timeval *restrict));
314 # else
315 _GL_CXXALIAS_SYS (select, int,
316 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
317 timeval *restrict));
318 # endif
319 _GL_CXXALIASWARN (select);
320 #elif @HAVE_WINSOCK2_H@
321 # undef select
322 # define select select_used_without_requesting_gnulib_module_select
323 #elif defined GNULIB_POSIXCHECK
324 # undef select
325 # if HAVE_RAW_DECL_SELECT
326 _GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
327 "use gnulib module select for portability");
328 # endif
329 #endif
330
331
332 #endif
333 #endif
334 #endif