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