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 # if !(defined __GLIBC__ || defined __CYGWIN__)
88 # include <sys/time.h>
89 # endif
90
91
92
93
94 # if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ || defined __BEOS__) \
95 && ! defined __GLIBC__
96 # include <string.h>
97 # endif
98
99
100 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
101
102 #endif
103
104
105
106
107
108
109
110
111
112
113
114
115 #if !((defined __GLIBC__ || defined __CYGWIN__ || defined __KLIBC__) \
116 && !defined __UCLIBC__)
117 # include <signal.h>
118 #endif
119
120 #ifndef _@GUARD_PREFIX@_SYS_SELECT_H
121 #define _@GUARD_PREFIX@_SYS_SELECT_H
122
123 #if !@HAVE_SYS_SELECT_H@
124
125
126
127 # include <sys/time.h>
128
129
130 # if defined __hpux
131 # include <string.h>
132 # endif
133
134
135
136 # if @HAVE_WINSOCK2_H@
137 # if !defined _GL_INCLUDING_WINSOCK2_H
138 # define _GL_INCLUDING_WINSOCK2_H
139 # include <winsock2.h>
140 # undef _GL_INCLUDING_WINSOCK2_H
141 # endif
142 # include <io.h>
143 # endif
144 #endif
145
146
147
148
149
150
151
152
153 #if @HAVE_WINSOCK2_H@
154
155 # if !GNULIB_defined_rpl_fd_isset
156
157
158
159 static int
160 rpl_fd_isset (SOCKET fd, fd_set * set)
161 {
162 u_int i;
163 if (set == NULL)
164 return 0;
165
166 for (i = 0; i < set->fd_count; i++)
167 if (set->fd_array[i] == fd)
168 return 1;
169
170 return 0;
171 }
172
173 # define GNULIB_defined_rpl_fd_isset 1
174 # endif
175
176 # undef FD_ISSET
177 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
178
179 #endif
180
181
182
183 #if @HAVE_WINSOCK2_H@
184 # if !defined _@GUARD_PREFIX@_UNISTD_H
185 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
186 # undef close
187 # define close close_used_without_including_unistd_h
188 # elif !defined __clang__
189 _GL_WARN_ON_USE (close,
190 "close() used without including <unistd.h>");
191 # endif
192 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
193 # undef gethostname
194 # define gethostname gethostname_used_without_including_unistd_h
195 # elif !defined __clang__
196 _GL_WARN_ON_USE (gethostname,
197 "gethostname() used without including <unistd.h>");
198 # endif
199 # endif
200 # if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
201 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
202 # undef socket
203 # define socket socket_used_without_including_sys_socket_h
204 # undef connect
205 # define connect connect_used_without_including_sys_socket_h
206 # undef accept
207 # define accept accept_used_without_including_sys_socket_h
208 # undef bind
209 # define bind bind_used_without_including_sys_socket_h
210 # undef getpeername
211 # define getpeername getpeername_used_without_including_sys_socket_h
212 # undef getsockname
213 # define getsockname getsockname_used_without_including_sys_socket_h
214 # undef getsockopt
215 # define getsockopt getsockopt_used_without_including_sys_socket_h
216 # undef listen
217 # define listen listen_used_without_including_sys_socket_h
218 # undef recv
219 # define recv recv_used_without_including_sys_socket_h
220 # undef send
221 # define send send_used_without_including_sys_socket_h
222 # undef recvfrom
223 # define recvfrom recvfrom_used_without_including_sys_socket_h
224 # undef sendto
225 # define sendto sendto_used_without_including_sys_socket_h
226 # undef setsockopt
227 # define setsockopt setsockopt_used_without_including_sys_socket_h
228 # undef shutdown
229 # define shutdown shutdown_used_without_including_sys_socket_h
230 # elif !defined __clang__
231 _GL_WARN_ON_USE (socket,
232 "socket() used without including <sys/socket.h>");
233 _GL_WARN_ON_USE (connect,
234 "connect() used without including <sys/socket.h>");
235 _GL_WARN_ON_USE (accept,
236 "accept() used without including <sys/socket.h>");
237 _GL_WARN_ON_USE (bind,
238 "bind() used without including <sys/socket.h>");
239 _GL_WARN_ON_USE (getpeername,
240 "getpeername() used without including <sys/socket.h>");
241 _GL_WARN_ON_USE (getsockname,
242 "getsockname() used without including <sys/socket.h>");
243 _GL_WARN_ON_USE (getsockopt,
244 "getsockopt() used without including <sys/socket.h>");
245 _GL_WARN_ON_USE (listen,
246 "listen() used without including <sys/socket.h>");
247 _GL_WARN_ON_USE (recv,
248 "recv() used without including <sys/socket.h>");
249 _GL_WARN_ON_USE (send,
250 "send() used without including <sys/socket.h>");
251 _GL_WARN_ON_USE (recvfrom,
252 "recvfrom() used without including <sys/socket.h>");
253 _GL_WARN_ON_USE (sendto,
254 "sendto() used without including <sys/socket.h>");
255 _GL_WARN_ON_USE (setsockopt,
256 "setsockopt() used without including <sys/socket.h>");
257 _GL_WARN_ON_USE (shutdown,
258 "shutdown() used without including <sys/socket.h>");
259 # endif
260 # endif
261 #endif
262
263
264 #if @GNULIB_PSELECT@
265 # if @REPLACE_PSELECT@
266 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
267 # undef pselect
268 # define pselect rpl_pselect
269 # endif
270 _GL_FUNCDECL_RPL (pselect, int,
271 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
272 struct timespec const *restrict, const sigset_t *restrict));
273 _GL_CXXALIAS_RPL (pselect, int,
274 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
275 struct timespec const *restrict, const sigset_t *restrict));
276 # else
277 # if !@HAVE_PSELECT@
278 _GL_FUNCDECL_SYS (pselect, int,
279 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
280 struct timespec const *restrict, const sigset_t *restrict));
281 # endif
282 _GL_CXXALIAS_SYS (pselect, int,
283 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
284 struct timespec const *restrict, const sigset_t *restrict));
285 # endif
286 _GL_CXXALIASWARN (pselect);
287 #elif defined GNULIB_POSIXCHECK
288 # undef pselect
289 # if HAVE_RAW_DECL_PSELECT
290 _GL_WARN_ON_USE (pselect, "pselect is not portable - "
291 "use gnulib module pselect for portability");
292 # endif
293 #endif
294
295 #if @GNULIB_SELECT@
296 # if @REPLACE_SELECT@
297 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
298 # undef select
299 # define select rpl_select
300 # endif
301 _GL_FUNCDECL_RPL (select, int,
302 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
303 struct timeval *restrict));
304 _GL_CXXALIAS_RPL (select, int,
305 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
306 timeval *restrict));
307 # else
308 _GL_CXXALIAS_SYS (select, int,
309 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
310 timeval *restrict));
311 # endif
312 _GL_CXXALIASWARN (select);
313 #elif @HAVE_WINSOCK2_H@
314 # undef select
315 # define select select_used_without_requesting_gnulib_module_select
316 #elif defined GNULIB_POSIXCHECK
317 # undef select
318 # if HAVE_RAW_DECL_SELECT
319 _GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
320 "use gnulib module select for portability");
321 # endif
322 #endif
323
324
325 #endif
326 #endif
327 #endif