dhcpd-pools  2.28
ISC dhcpd lease usage analyser
socket.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
3  and for systems where it is incomplete.
4  Copyright (C) 2005-2015 Free Software Foundation, Inc.
5  Written by Simon Josefsson.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3, or (at your option)
10  any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, see <http://www.gnu.org/licenses/>. */
19 
20 /* This file is supposed to be used on platforms that lack <sys/socket.h>,
21  on platforms where <sys/socket.h> cannot be included standalone, and on
22  platforms where <sys/socket.h> does not provide all necessary definitions.
23  It is intended to provide definitions and prototypes needed by an
24  application. */
25 
26 #if __GNUC__ >= 3
27 #pragma GCC system_header
28 #endif
29 
30 
31 #if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
32 /* Special invocation convention:
33  - On Cygwin 1.5.x we have a sequence of nested includes
34  <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
35  and the latter includes <sys/socket.h>. In this situation, the functions
36  are not yet declared, therefore we cannot provide the C++ aliases. */
37 
38 #include_next <sys/socket.h>
39 
40 #else
41 /* Normal invocation convention. */
42 
43 #ifndef _GL_SYS_SOCKET_H
44 
45 #if 1
46 
47 # define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
48 
49 /* On many platforms, <sys/socket.h> assumes prior inclusion of
50  <sys/types.h>. */
51 # include <sys/types.h>
52 
53 /* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL
54  is defined. */
55 # include <stddef.h>
56 
57 /* The include_next requires a split double-inclusion guard. */
58 # include_next <sys/socket.h>
59 
60 # undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
61 
62 #endif
63 
64 #ifndef _GL_SYS_SOCKET_H
65 #define _GL_SYS_SOCKET_H
66 
67 #ifndef _GL_INLINE_HEADER_BEGIN
68  #error "Please include config.h first."
69 #endif
71 #ifndef _GL_SYS_SOCKET_INLINE
72 # define _GL_SYS_SOCKET_INLINE _GL_INLINE
73 #endif
74 
75 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
76 #ifndef _GL_CXXDEFS_H
77 #define _GL_CXXDEFS_H
78 
79 /* The three most frequent use cases of these macros are:
80 
81  * For providing a substitute for a function that is missing on some
82  platforms, but is declared and works fine on the platforms on which
83  it exists:
84 
85  #if @GNULIB_FOO@
86  # if !@HAVE_FOO@
87  _GL_FUNCDECL_SYS (foo, ...);
88  # endif
89  _GL_CXXALIAS_SYS (foo, ...);
90  _GL_CXXALIASWARN (foo);
91  #elif defined GNULIB_POSIXCHECK
92  ...
93  #endif
94 
95  * For providing a replacement for a function that exists on all platforms,
96  but is broken/insufficient and needs to be replaced on some platforms:
97 
98  #if @GNULIB_FOO@
99  # if @REPLACE_FOO@
100  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
101  # undef foo
102  # define foo rpl_foo
103  # endif
104  _GL_FUNCDECL_RPL (foo, ...);
105  _GL_CXXALIAS_RPL (foo, ...);
106  # else
107  _GL_CXXALIAS_SYS (foo, ...);
108  # endif
109  _GL_CXXALIASWARN (foo);
110  #elif defined GNULIB_POSIXCHECK
111  ...
112  #endif
113 
114  * For providing a replacement for a function that exists on some platforms
115  but is broken/insufficient and needs to be replaced on some of them and
116  is additionally either missing or undeclared on some other platforms:
117 
118  #if @GNULIB_FOO@
119  # if @REPLACE_FOO@
120  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
121  # undef foo
122  # define foo rpl_foo
123  # endif
124  _GL_FUNCDECL_RPL (foo, ...);
125  _GL_CXXALIAS_RPL (foo, ...);
126  # else
127  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
128  _GL_FUNCDECL_SYS (foo, ...);
129  # endif
130  _GL_CXXALIAS_SYS (foo, ...);
131  # endif
132  _GL_CXXALIASWARN (foo);
133  #elif defined GNULIB_POSIXCHECK
134  ...
135  #endif
136 */
137 
138 /* _GL_EXTERN_C declaration;
139  performs the declaration with C linkage. */
140 #if defined __cplusplus
141 # define _GL_EXTERN_C extern "C"
142 #else
143 # define _GL_EXTERN_C extern
144 #endif
145 
146 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
147  declares a replacement function, named rpl_func, with the given prototype,
148  consisting of return type, parameters, and attributes.
149  Example:
150  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
151  _GL_ARG_NONNULL ((1)));
152  */
153 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
154  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
155 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
156  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
157 
158 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
159  declares the system function, named func, with the given prototype,
160  consisting of return type, parameters, and attributes.
161  Example:
162  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
163  _GL_ARG_NONNULL ((1)));
164  */
165 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
166  _GL_EXTERN_C rettype func parameters_and_attributes
167 
168 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
169  declares a C++ alias called GNULIB_NAMESPACE::func
170  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
171  Example:
172  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
173  */
174 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
175  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
176 #if defined __cplusplus && defined GNULIB_NAMESPACE
177 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
178  namespace GNULIB_NAMESPACE \
179  { \
180  rettype (*const func) parameters = ::rpl_func; \
181  } \
182  _GL_EXTERN_C int _gl_cxxalias_dummy
183 #else
184 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
185  _GL_EXTERN_C int _gl_cxxalias_dummy
186 #endif
187 
188 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
189  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
190  except that the C function rpl_func may have a slightly different
191  declaration. A cast is used to silence the "invalid conversion" error
192  that would otherwise occur. */
193 #if defined __cplusplus && defined GNULIB_NAMESPACE
194 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
195  namespace GNULIB_NAMESPACE \
196  { \
197  rettype (*const func) parameters = \
198  reinterpret_cast<rettype(*)parameters>(::rpl_func); \
199  } \
200  _GL_EXTERN_C int _gl_cxxalias_dummy
201 #else
202 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
203  _GL_EXTERN_C int _gl_cxxalias_dummy
204 #endif
205 
206 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
207  declares a C++ alias called GNULIB_NAMESPACE::func
208  that redirects to the system provided function func, if GNULIB_NAMESPACE
209  is defined.
210  Example:
211  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
212  */
213 #if defined __cplusplus && defined GNULIB_NAMESPACE
214  /* If we were to write
215  rettype (*const func) parameters = ::func;
216  like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
217  better (remove an indirection through a 'static' pointer variable),
218  but then the _GL_CXXALIASWARN macro below would cause a warning not only
219  for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
220 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
221  namespace GNULIB_NAMESPACE \
222  { \
223  static rettype (*func) parameters = ::func; \
224  } \
225  _GL_EXTERN_C int _gl_cxxalias_dummy
226 #else
227 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
228  _GL_EXTERN_C int _gl_cxxalias_dummy
229 #endif
230 
231 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
232  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
233  except that the C function func may have a slightly different declaration.
234  A cast is used to silence the "invalid conversion" error that would
235  otherwise occur. */
236 #if defined __cplusplus && defined GNULIB_NAMESPACE
237 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
238  namespace GNULIB_NAMESPACE \
239  { \
240  static rettype (*func) parameters = \
241  reinterpret_cast<rettype(*)parameters>(::func); \
242  } \
243  _GL_EXTERN_C int _gl_cxxalias_dummy
244 #else
245 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
246  _GL_EXTERN_C int _gl_cxxalias_dummy
247 #endif
248 
249 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
250  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
251  except that the C function is picked among a set of overloaded functions,
252  namely the one with rettype2 and parameters2. Two consecutive casts
253  are used to silence the "cannot find a match" and "invalid conversion"
254  errors that would otherwise occur. */
255 #if defined __cplusplus && defined GNULIB_NAMESPACE
256  /* The outer cast must be a reinterpret_cast.
257  The inner cast: When the function is defined as a set of overloaded
258  functions, it works as a static_cast<>, choosing the designated variant.
259  When the function is defined as a single variant, it works as a
260  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
261 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
262  namespace GNULIB_NAMESPACE \
263  { \
264  static rettype (*func) parameters = \
265  reinterpret_cast<rettype(*)parameters>( \
266  (rettype2(*)parameters2)(::func)); \
267  } \
268  _GL_EXTERN_C int _gl_cxxalias_dummy
269 #else
270 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
271  _GL_EXTERN_C int _gl_cxxalias_dummy
272 #endif
273 
274 /* _GL_CXXALIASWARN (func);
275  causes a warning to be emitted when ::func is used but not when
276  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
277  variants. */
278 #if defined __cplusplus && defined GNULIB_NAMESPACE
279 # define _GL_CXXALIASWARN(func) \
280  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
281 # define _GL_CXXALIASWARN_1(func,namespace) \
282  _GL_CXXALIASWARN_2 (func, namespace)
283 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
284  we enable the warning only when not optimizing. */
285 # if !__OPTIMIZE__
286 # define _GL_CXXALIASWARN_2(func,namespace) \
287  _GL_WARN_ON_USE (func, \
288  "The symbol ::" #func " refers to the system function. " \
289  "Use " #namespace "::" #func " instead.")
290 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
291 # define _GL_CXXALIASWARN_2(func,namespace) \
292  extern __typeof__ (func) func
293 # else
294 # define _GL_CXXALIASWARN_2(func,namespace) \
295  _GL_EXTERN_C int _gl_cxxalias_dummy
296 # endif
297 #else
298 # define _GL_CXXALIASWARN(func) \
299  _GL_EXTERN_C int _gl_cxxalias_dummy
300 #endif
301 
302 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
303  causes a warning to be emitted when the given overloaded variant of ::func
304  is used but not when GNULIB_NAMESPACE::func is used. */
305 #if defined __cplusplus && defined GNULIB_NAMESPACE
306 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
307  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
308  GNULIB_NAMESPACE)
309 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
310  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
311 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
312  we enable the warning only when not optimizing. */
313 # if !__OPTIMIZE__
314 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
315  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
316  "The symbol ::" #func " refers to the system function. " \
317  "Use " #namespace "::" #func " instead.")
318 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
319 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
320  extern __typeof__ (func) func
321 # else
322 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
323  _GL_EXTERN_C int _gl_cxxalias_dummy
324 # endif
325 #else
326 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
327  _GL_EXTERN_C int _gl_cxxalias_dummy
328 #endif
329 
330 #endif /* _GL_CXXDEFS_H */
331 
332 /* The definition of _GL_ARG_NONNULL is copied here. */
333 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
334  that the values passed as arguments n, ..., m must be non-NULL pointers.
335  n = 1 stands for the first argument, n = 2 for the second argument etc. */
336 #ifndef _GL_ARG_NONNULL
337 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
338 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
339 # else
340 # define _GL_ARG_NONNULL(params)
341 # endif
342 #endif
343 
344 /* The definition of _GL_WARN_ON_USE is copied here. */
345 #ifndef _GL_WARN_ON_USE
346 
347 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
348 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
349 # define _GL_WARN_ON_USE(function, message) \
350 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
351 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
352 /* Verify the existence of the function. */
353 # define _GL_WARN_ON_USE(function, message) \
354 extern __typeof__ (function) function
355 # else /* Unsupported. */
356 # define _GL_WARN_ON_USE(function, message) \
357 _GL_WARN_EXTERN_C int _gl_warn_on_use
358 # endif
359 #endif
360 
361 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
362  is like _GL_WARN_ON_USE (function, "string"), except that the function is
363  declared with the given prototype, consisting of return type, parameters,
364  and attributes.
365  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
366  not work in this case. */
367 #ifndef _GL_WARN_ON_USE_CXX
368 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
369 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
370 extern rettype function parameters_and_attributes \
371  __attribute__ ((__warning__ (msg)))
372 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
373 /* Verify the existence of the function. */
374 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
375 extern rettype function parameters_and_attributes
376 # else /* Unsupported. */
377 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
378 _GL_WARN_EXTERN_C int _gl_warn_on_use
379 # endif
380 #endif
381 
382 /* _GL_WARN_EXTERN_C declaration;
383  performs the declaration with C linkage. */
384 #ifndef _GL_WARN_EXTERN_C
385 # if defined __cplusplus
386 # define _GL_WARN_EXTERN_C extern "C"
387 # else
388 # define _GL_WARN_EXTERN_C extern
389 # endif
390 #endif
391 
392 #if !1
393 # if !GNULIB_defined_sa_family_t
394 typedef unsigned short sa_family_t;
395 # define GNULIB_defined_sa_family_t 1
396 # endif
397 #endif
398 
399 #if 1
400 /* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1. */
401 # if !1
402 # ifndef ss_family
403 # define ss_family __ss_family
404 # endif
405 # endif
406 #else
407 # include <stdalign.h>
408 /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
409  2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
410 # define __ss_aligntype unsigned long int
411 # define _SS_SIZE 256
412 # define _SS_PADSIZE \
413  (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
414  ? sizeof (sa_family_t) \
415  : alignof (__ss_aligntype)) \
416  + sizeof (__ss_aligntype)))
417 
418 # if !GNULIB_defined_struct_sockaddr_storage
419 struct sockaddr_storage
420 {
421  sa_family_t ss_family; /* Address family, etc. */
422  __ss_aligntype __ss_align; /* Force desired alignment. */
424 };
425 # define GNULIB_defined_struct_sockaddr_storage 1
426 # endif
427 
428 #endif
429 
430 /* Get struct iovec. */
431 /* But avoid namespace pollution on glibc systems. */
432 #if ! defined __GLIBC__
433 # include <sys/uio.h>
434 #endif
435 
436 #if 1
437 
438 /* A platform that has <sys/socket.h>. */
439 
440 /* For shutdown(). */
441 # if !defined SHUT_RD
442 # define SHUT_RD 0
443 # endif
444 # if !defined SHUT_WR
445 # define SHUT_WR 1
446 # endif
447 # if !defined SHUT_RDWR
448 # define SHUT_RDWR 2
449 # endif
450 
451 #else
452 
453 # ifdef __CYGWIN__
454 # error "Cygwin does have a sys/socket.h, doesn't it?!?"
455 # endif
456 
457 /* A platform that lacks <sys/socket.h>.
458 
459  Currently only MinGW is supported. See the gnulib manual regarding
460  Windows sockets. MinGW has the header files winsock2.h and
461  ws2tcpip.h that declare the sys/socket.h definitions we need. Note
462  that you can influence which definitions you get by setting the
463  WINVER symbol before including these two files. For example,
464  getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
465  symbol is set indirectly through WINVER). You can set this by
466  adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
467  code may not run on older Windows releases then. My Windows 2000
468  box was not able to run the code, for example. The situation is
469  slightly confusing because
470  <http://msdn.microsoft.com/en-us/library/ms738520>
471  suggests that getaddrinfo should be available on all Windows
472  releases. */
473 
474 # if 0
475 # include <winsock2.h>
476 # endif
477 # if 0
478 # include <ws2tcpip.h>
479 # endif
480 
481 /* For shutdown(). */
482 # if !defined SHUT_RD && defined SD_RECEIVE
483 # define SHUT_RD SD_RECEIVE
484 # endif
485 # if !defined SHUT_WR && defined SD_SEND
486 # define SHUT_WR SD_SEND
487 # endif
488 # if !defined SHUT_RDWR && defined SD_BOTH
489 # define SHUT_RDWR SD_BOTH
490 # endif
491 
492 # if 0
493 /* Include headers needed by the emulation code. */
494 # include <sys/types.h>
495 # include <io.h>
496 
497 # if !GNULIB_defined_socklen_t
498 typedef int socklen_t;
499 # define GNULIB_defined_socklen_t 1
500 # endif
501 
502 # endif
503 
504 /* Rudimentary 'struct msghdr'; this works as long as you don't try to
505  access msg_control or msg_controllen. */
506 struct msghdr {
507  void *msg_name;
508  socklen_t msg_namelen;
509  struct iovec *msg_iov;
510  int msg_iovlen;
511  int msg_flags;
512 };
513 
514 #endif
515 
516 /* Fix some definitions from <winsock2.h>. */
517 
518 #if 0
519 
520 # if !GNULIB_defined_rpl_fd_isset
521 
522 /* Re-define FD_ISSET to avoid a WSA call while we are not using
523  network sockets. */
525 rpl_fd_isset (SOCKET fd, fd_set * set)
526 {
527  u_int i;
528  if (set == NULL)
529  return 0;
530 
531  for (i = 0; i < set->fd_count; i++)
532  if (set->fd_array[i] == fd)
533  return 1;
534 
535  return 0;
536 }
537 
538 # define GNULIB_defined_rpl_fd_isset 1
539 # endif
540 
541 # undef FD_ISSET
542 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
543 
544 #endif
545 
546 /* Hide some function declarations from <winsock2.h>. */
547 
548 #if 0
549 # if !defined _GL_UNISTD_H
550 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
551 # undef close
552 # define close close_used_without_including_unistd_h
553 # else
554  _GL_WARN_ON_USE (close,
555  "close() used without including <unistd.h>");
556 # endif
557 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
558 # undef gethostname
559 # define gethostname gethostname_used_without_including_unistd_h
560 # else
561  _GL_WARN_ON_USE (gethostname,
562  "gethostname() used without including <unistd.h>");
563 # endif
564 # endif
565 # if !defined _GL_SYS_SELECT_H
566 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
567 # undef select
568 # define select select_used_without_including_sys_select_h
569 # else
570  _GL_WARN_ON_USE (select,
571  "select() used without including <sys/select.h>");
572 # endif
573 # endif
574 #endif
575 
576 /* Wrap everything else to use libc file descriptors for sockets. */
577 
578 #if 0
579 # if 0
580 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
581 # undef socket
582 # define socket rpl_socket
583 # endif
584 _GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol));
585 _GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
586 # else
587 _GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
588 # endif
589 _GL_CXXALIASWARN (socket);
590 #elif 0
591 # undef socket
592 # define socket socket_used_without_requesting_gnulib_module_socket
593 #elif defined GNULIB_POSIXCHECK
594 # undef socket
595 # if HAVE_RAW_DECL_SOCKET
596 _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
597  "use gnulib module socket for portability");
598 # endif
599 #endif
600 
601 #if 0
602 # if 0
603 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
604 # undef connect
605 # define connect rpl_connect
606 # endif
607 _GL_FUNCDECL_RPL (connect, int,
608  (int fd, const struct sockaddr *addr, socklen_t addrlen)
609  _GL_ARG_NONNULL ((2)));
610 _GL_CXXALIAS_RPL (connect, int,
611  (int fd, const struct sockaddr *addr, socklen_t addrlen));
612 # else
613 /* Need to cast, because on NonStop Kernel, the third parameter is
614  size_t addrlen. */
615 _GL_CXXALIAS_SYS_CAST (connect, int,
616  (int fd,
617  const struct sockaddr *addr, socklen_t addrlen));
618 # endif
619 _GL_CXXALIASWARN (connect);
620 #elif 0
621 # undef connect
622 # define connect socket_used_without_requesting_gnulib_module_connect
623 #elif defined GNULIB_POSIXCHECK
624 # undef connect
625 # if HAVE_RAW_DECL_CONNECT
626 _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
627  "use gnulib module connect for portability");
628 # endif
629 #endif
630 
631 #if 0
632 # if 0
633 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
634 # undef accept
635 # define accept rpl_accept
636 # endif
637 _GL_FUNCDECL_RPL (accept, int,
638  (int fd, struct sockaddr *addr, socklen_t *addrlen));
639 _GL_CXXALIAS_RPL (accept, int,
640  (int fd, struct sockaddr *addr, socklen_t *addrlen));
641 # else
642 /* Need to cast, because on Solaris 10 systems, the third parameter is
643  void *addrlen. */
644 _GL_CXXALIAS_SYS_CAST (accept, int,
645  (int fd, struct sockaddr *addr, socklen_t *addrlen));
646 # endif
647 _GL_CXXALIASWARN (accept);
648 #elif 0
649 # undef accept
650 # define accept accept_used_without_requesting_gnulib_module_accept
651 #elif defined GNULIB_POSIXCHECK
652 # undef accept
653 # if HAVE_RAW_DECL_ACCEPT
654 _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
655  "use gnulib module accept for portability");
656 # endif
657 #endif
658 
659 #if 0
660 # if 0
661 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
662 # undef bind
663 # define bind rpl_bind
664 # endif
665 _GL_FUNCDECL_RPL (bind, int,
666  (int fd, const struct sockaddr *addr, socklen_t addrlen)
667  _GL_ARG_NONNULL ((2)));
668 _GL_CXXALIAS_RPL (bind, int,
669  (int fd, const struct sockaddr *addr, socklen_t addrlen));
670 # else
671 /* Need to cast, because on NonStop Kernel, the third parameter is
672  size_t addrlen. */
673 _GL_CXXALIAS_SYS_CAST (bind, int,
674  (int fd,
675  const struct sockaddr *addr, socklen_t addrlen));
676 # endif
677 _GL_CXXALIASWARN (bind);
678 #elif 0
679 # undef bind
680 # define bind bind_used_without_requesting_gnulib_module_bind
681 #elif defined GNULIB_POSIXCHECK
682 # undef bind
683 # if HAVE_RAW_DECL_BIND
684 _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
685  "use gnulib module bind for portability");
686 # endif
687 #endif
688 
689 #if 0
690 # if 0
691 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
692 # undef getpeername
693 # define getpeername rpl_getpeername
694 # endif
695 _GL_FUNCDECL_RPL (getpeername, int,
696  (int fd, struct sockaddr *addr, socklen_t *addrlen)
697  _GL_ARG_NONNULL ((2, 3)));
698 _GL_CXXALIAS_RPL (getpeername, int,
699  (int fd, struct sockaddr *addr, socklen_t *addrlen));
700 # else
701 /* Need to cast, because on Solaris 10 systems, the third parameter is
702  void *addrlen. */
703 _GL_CXXALIAS_SYS_CAST (getpeername, int,
704  (int fd, struct sockaddr *addr, socklen_t *addrlen));
705 # endif
706 _GL_CXXALIASWARN (getpeername);
707 #elif 0
708 # undef getpeername
709 # define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
710 #elif defined GNULIB_POSIXCHECK
711 # undef getpeername
712 # if HAVE_RAW_DECL_GETPEERNAME
713 _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
714  "use gnulib module getpeername for portability");
715 # endif
716 #endif
717 
718 #if 0
719 # if 0
720 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
721 # undef getsockname
722 # define getsockname rpl_getsockname
723 # endif
724 _GL_FUNCDECL_RPL (getsockname, int,
725  (int fd, struct sockaddr *addr, socklen_t *addrlen)
726  _GL_ARG_NONNULL ((2, 3)));
727 _GL_CXXALIAS_RPL (getsockname, int,
728  (int fd, struct sockaddr *addr, socklen_t *addrlen));
729 # else
730 /* Need to cast, because on Solaris 10 systems, the third parameter is
731  void *addrlen. */
732 _GL_CXXALIAS_SYS_CAST (getsockname, int,
733  (int fd, struct sockaddr *addr, socklen_t *addrlen));
734 # endif
735 _GL_CXXALIASWARN (getsockname);
736 #elif 0
737 # undef getsockname
738 # define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
739 #elif defined GNULIB_POSIXCHECK
740 # undef getsockname
741 # if HAVE_RAW_DECL_GETSOCKNAME
742 _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
743  "use gnulib module getsockname for portability");
744 # endif
745 #endif
746 
747 #if 0
748 # if 0
749 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
750 # undef getsockopt
751 # define getsockopt rpl_getsockopt
752 # endif
753 _GL_FUNCDECL_RPL (getsockopt, int, (int fd, int level, int optname,
754  void *optval, socklen_t *optlen)
755  _GL_ARG_NONNULL ((4, 5)));
756 _GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname,
757  void *optval, socklen_t *optlen));
758 # else
759 /* Need to cast, because on Solaris 10 systems, the fifth parameter is
760  void *optlen. */
761 _GL_CXXALIAS_SYS_CAST (getsockopt, int, (int fd, int level, int optname,
762  void *optval, socklen_t *optlen));
763 # endif
764 _GL_CXXALIASWARN (getsockopt);
765 #elif 0
766 # undef getsockopt
767 # define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
768 #elif defined GNULIB_POSIXCHECK
769 # undef getsockopt
770 # if HAVE_RAW_DECL_GETSOCKOPT
771 _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
772  "use gnulib module getsockopt for portability");
773 # endif
774 #endif
775 
776 #if 0
777 # if 0
778 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
779 # undef listen
780 # define listen rpl_listen
781 # endif
782 _GL_FUNCDECL_RPL (listen, int, (int fd, int backlog));
783 _GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
784 # else
785 _GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
786 # endif
787 _GL_CXXALIASWARN (listen);
788 #elif 0
789 # undef listen
790 # define listen listen_used_without_requesting_gnulib_module_listen
791 #elif defined GNULIB_POSIXCHECK
792 # undef listen
793 # if HAVE_RAW_DECL_LISTEN
794 _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
795  "use gnulib module listen for portability");
796 # endif
797 #endif
798 
799 #if 0
800 # if 0
801 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
802 # undef recv
803 # define recv rpl_recv
804 # endif
805 _GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
806  _GL_ARG_NONNULL ((2)));
807 _GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
808 # else
809 _GL_CXXALIAS_SYS (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
810 # endif
811 _GL_CXXALIASWARN (recv);
812 #elif 0
813 # undef recv
814 # define recv recv_used_without_requesting_gnulib_module_recv
815 #elif defined GNULIB_POSIXCHECK
816 # undef recv
817 # if HAVE_RAW_DECL_RECV
818 _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
819  "use gnulib module recv for portability");
820 # endif
821 #endif
822 
823 #if 0
824 # if 0
825 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
826 # undef send
827 # define send rpl_send
828 # endif
829 _GL_FUNCDECL_RPL (send, ssize_t,
830  (int fd, const void *buf, size_t len, int flags)
831  _GL_ARG_NONNULL ((2)));
832 _GL_CXXALIAS_RPL (send, ssize_t,
833  (int fd, const void *buf, size_t len, int flags));
834 # else
835 _GL_CXXALIAS_SYS (send, ssize_t,
836  (int fd, const void *buf, size_t len, int flags));
837 # endif
838 _GL_CXXALIASWARN (send);
839 #elif 0
840 # undef send
841 # define send send_used_without_requesting_gnulib_module_send
842 #elif defined GNULIB_POSIXCHECK
843 # undef send
844 # if HAVE_RAW_DECL_SEND
845 _GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
846  "use gnulib module send for portability");
847 # endif
848 #endif
849 
850 #if 0
851 # if 0
852 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
853 # undef recvfrom
854 # define recvfrom rpl_recvfrom
855 # endif
856 _GL_FUNCDECL_RPL (recvfrom, ssize_t,
857  (int fd, void *buf, size_t len, int flags,
858  struct sockaddr *from, socklen_t *fromlen)
859  _GL_ARG_NONNULL ((2)));
860 _GL_CXXALIAS_RPL (recvfrom, ssize_t,
861  (int fd, void *buf, size_t len, int flags,
862  struct sockaddr *from, socklen_t *fromlen));
863 # else
864 /* Need to cast, because on Solaris 10 systems, the sixth parameter is
865  void *fromlen. */
866 _GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
867  (int fd, void *buf, size_t len, int flags,
868  struct sockaddr *from, socklen_t *fromlen));
869 # endif
870 _GL_CXXALIASWARN (recvfrom);
871 #elif 0
872 # undef recvfrom
873 # define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
874 #elif defined GNULIB_POSIXCHECK
875 # undef recvfrom
876 # if HAVE_RAW_DECL_RECVFROM
877 _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
878  "use gnulib module recvfrom for portability");
879 # endif
880 #endif
881 
882 #if 0
883 # if 0
884 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
885 # undef sendto
886 # define sendto rpl_sendto
887 # endif
888 _GL_FUNCDECL_RPL (sendto, ssize_t,
889  (int fd, const void *buf, size_t len, int flags,
890  const struct sockaddr *to, socklen_t tolen)
891  _GL_ARG_NONNULL ((2)));
892 _GL_CXXALIAS_RPL (sendto, ssize_t,
893  (int fd, const void *buf, size_t len, int flags,
894  const struct sockaddr *to, socklen_t tolen));
895 # else
896 /* Need to cast, because on NonStop Kernel, the sixth parameter is
897  size_t tolen. */
898 _GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
899  (int fd, const void *buf, size_t len, int flags,
900  const struct sockaddr *to, socklen_t tolen));
901 # endif
902 _GL_CXXALIASWARN (sendto);
903 #elif 0
904 # undef sendto
905 # define sendto sendto_used_without_requesting_gnulib_module_sendto
906 #elif defined GNULIB_POSIXCHECK
907 # undef sendto
908 # if HAVE_RAW_DECL_SENDTO
909 _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
910  "use gnulib module sendto for portability");
911 # endif
912 #endif
913 
914 #if 0
915 # if 0
916 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
917 # undef setsockopt
918 # define setsockopt rpl_setsockopt
919 # endif
920 _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
921  const void * optval, socklen_t optlen)
922  _GL_ARG_NONNULL ((4)));
923 _GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
924  const void * optval, socklen_t optlen));
925 # else
926 /* Need to cast, because on NonStop Kernel, the fifth parameter is
927  size_t optlen. */
928 _GL_CXXALIAS_SYS_CAST (setsockopt, int,
929  (int fd, int level, int optname,
930  const void * optval, socklen_t optlen));
931 # endif
932 _GL_CXXALIASWARN (setsockopt);
933 #elif 0
934 # undef setsockopt
935 # define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
936 #elif defined GNULIB_POSIXCHECK
937 # undef setsockopt
938 # if HAVE_RAW_DECL_SETSOCKOPT
939 _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
940  "use gnulib module setsockopt for portability");
941 # endif
942 #endif
943 
944 #if 0
945 # if 0
946 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
947 # undef shutdown
948 # define shutdown rpl_shutdown
949 # endif
950 _GL_FUNCDECL_RPL (shutdown, int, (int fd, int how));
951 _GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
952 # else
953 _GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
954 # endif
955 _GL_CXXALIASWARN (shutdown);
956 #elif 0
957 # undef shutdown
958 # define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
959 #elif defined GNULIB_POSIXCHECK
960 # undef shutdown
961 # if HAVE_RAW_DECL_SHUTDOWN
962 _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
963  "use gnulib module shutdown for portability");
964 # endif
965 #endif
966 
967 #if 0
968 /* Accept a connection on a socket, with specific opening flags.
969  The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
970  and O_TEXT, O_BINARY (defined in "binary-io.h").
971  See also the Linux man page at
972  <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
973 # if 1
974 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
975 # define accept4 rpl_accept4
976 # endif
977 _GL_FUNCDECL_RPL (accept4, int,
978  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
979  int flags));
980 _GL_CXXALIAS_RPL (accept4, int,
981  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
982  int flags));
983 # else
984 _GL_FUNCDECL_SYS (accept4, int,
985  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
986  int flags));
987 _GL_CXXALIAS_SYS (accept4, int,
988  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
989  int flags));
990 # endif
991 _GL_CXXALIASWARN (accept4);
992 #elif defined GNULIB_POSIXCHECK
993 # undef accept4
994 # if HAVE_RAW_DECL_ACCEPT4
995 _GL_WARN_ON_USE (accept4, "accept4 is unportable - "
996  "use gnulib module accept4 for portability");
997 # endif
998 #endif
999 
1001 
1002 #endif /* _GL_SYS_SOCKET_H */
1003 #endif /* _GL_SYS_SOCKET_H */
1004 #endif
int msg_iovlen
Definition: sys_socket.in.h:198
unsigned short sa_family_t
Definition: sys_socket.in.h:82
socklen_t msg_namelen
Definition: sys_socket.in.h:196
Definition: sys_socket.in.h:194
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: socket.h:165
#define _GL_ARG_NONNULL(params)
Definition: socket.h:340
void * msg_name
Definition: sys_socket.in.h:195
#define _SS_PADSIZE
Definition: sys_socket.in.h:100
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
Definition: socket.h:245
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: socket.h:227
sa_family_t ss_family
Definition: sys_socket.in.h:109
#define NULL
Definition: getopt1.c:36
struct iovec * msg_iov
Definition: sys_socket.in.h:197
int msg_flags
Definition: sys_socket.in.h:199
Definition: sys_socket.in.h:107
char __ss_padding[_SS_PADSIZE]
Definition: sys_socket.in.h:111
Definition: sys_uio.in.h:49
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: socket.h:174
#define __ss_aligntype
Definition: sys_socket.in.h:98
#define _GL_SYS_SOCKET_INLINE
Definition: socket.h:72
#define _GL_INLINE_HEADER_BEGIN
Definition: config.h:1720
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: socket.h:153
#define _GL_INLINE_HEADER_END
Definition: config.h:1721
#define _GL_WARN_ON_USE(function, message)
Definition: socket.h:356
#define _GL_CXXALIASWARN(func)
Definition: socket.h:298
__ss_aligntype __ss_align
Definition: sys_socket.in.h:110