summaryrefslogtreecommitdiffstats
path: root/gl/sys_socket.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/sys_socket.in.h')
-rw-r--r--gl/sys_socket.in.h145
1 files changed, 80 insertions, 65 deletions
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index 13833c0f..c19b7461 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -1,6 +1,6 @@
1/* Provide a sys/socket header file for systems lacking it (read: MinGW) 1/* Provide a sys/socket header file for systems lacking it (read: MinGW)
2 and for systems where it is incomplete. 2 and for systems where it is incomplete.
3 Copyright (C) 2005-2024 Free Software Foundation, Inc. 3 Copyright (C) 2005-2026 Free Software Foundation, Inc.
4 Written by Simon Josefsson. 4 Written by Simon Josefsson.
5 5
6 This file is free software: you can redistribute it and/or modify 6 This file is free software: you can redistribute it and/or modify
@@ -27,7 +27,7 @@
27#endif 27#endif
28@PRAGMA_COLUMNS@ 28@PRAGMA_COLUMNS@
29 29
30#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H 30#if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H
31/* Special invocation convention: 31/* Special invocation convention:
32 - On Cygwin 1.5.x we have a sequence of nested includes 32 - On Cygwin 1.5.x we have a sequence of nested includes
33 <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>, 33 <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
@@ -43,7 +43,7 @@
43 43
44#if @HAVE_SYS_SOCKET_H@ 44#if @HAVE_SYS_SOCKET_H@
45 45
46# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H 46# define _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H
47 47
48/* On many platforms, <sys/socket.h> assumes prior inclusion of 48/* On many platforms, <sys/socket.h> assumes prior inclusion of
49 <sys/types.h>. */ 49 <sys/types.h>. */
@@ -56,7 +56,7 @@
56/* The include_next requires a split double-inclusion guard. */ 56/* The include_next requires a split double-inclusion guard. */
57# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ 57# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
58 58
59# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H 59# undef _@GUARD_PREFIX@_ALREADY_INCLUDING_SYS_SOCKET_H
60 60
61#endif 61#endif
62 62
@@ -202,6 +202,7 @@ struct sockaddr_storage
202 202
203/* Rudimentary 'struct msghdr'; this works as long as you don't try to 203/* Rudimentary 'struct msghdr'; this works as long as you don't try to
204 access msg_control or msg_controllen. */ 204 access msg_control or msg_controllen. */
205# if !defined GNULIB_defined_struct_msghdr
205struct msghdr { 206struct msghdr {
206 void *msg_name; 207 void *msg_name;
207 socklen_t msg_namelen; 208 socklen_t msg_namelen;
@@ -209,6 +210,8 @@ struct msghdr {
209 int msg_iovlen; 210 int msg_iovlen;
210 int msg_flags; 211 int msg_flags;
211}; 212};
213# define GNULIB_defined_struct_msghdr 1
214# endif
212 215
213#endif 216#endif
214 217
@@ -232,11 +235,10 @@ struct msghdr {
232_GL_SYS_SOCKET_INLINE int 235_GL_SYS_SOCKET_INLINE int
233rpl_fd_isset (SOCKET fd, fd_set * set) 236rpl_fd_isset (SOCKET fd, fd_set * set)
234{ 237{
235 u_int i;
236 if (set == NULL) 238 if (set == NULL)
237 return 0; 239 return 0;
238 240
239 for (i = 0; i < set->fd_count; i++) 241 for (u_int i = 0; i < set->fd_count; i++)
240 if (set->fd_array[i] == fd) 242 if (set->fd_array[i] == fd)
241 return 1; 243 return 1;
242 244
@@ -289,17 +291,18 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
289# undef socket 291# undef socket
290# define socket rpl_socket 292# define socket rpl_socket
291# endif 293# endif
292_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol)); 294_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol), );
293_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol)); 295_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
294# else 296# else
295_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol)); 297_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
296# endif 298# endif
297_GL_CXXALIASWARN (socket); 299_GL_CXXALIASWARN (socket);
298#elif @HAVE_WINSOCK2_H@ 300#elif @HAVE_WINSOCK2_H@
299# undef socket 301# if !GNULIB_SOCKET
300# define socket socket_used_without_requesting_gnulib_module_socket 302# undef socket
303# define socket socket_used_without_requesting_gnulib_module_socket
304# endif
301#elif defined GNULIB_POSIXCHECK 305#elif defined GNULIB_POSIXCHECK
302# undef socket
303# if HAVE_RAW_DECL_SOCKET 306# if HAVE_RAW_DECL_SOCKET
304_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - " 307_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
305 "use gnulib module socket for portability"); 308 "use gnulib module socket for portability");
@@ -313,7 +316,7 @@ _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
313# define connect rpl_connect 316# define connect rpl_connect
314# endif 317# endif
315_GL_FUNCDECL_RPL (connect, int, 318_GL_FUNCDECL_RPL (connect, int,
316 (int fd, const struct sockaddr *addr, socklen_t addrlen) 319 (int fd, const struct sockaddr *addr, socklen_t addrlen),
317 _GL_ARG_NONNULL ((2))); 320 _GL_ARG_NONNULL ((2)));
318_GL_CXXALIAS_RPL (connect, int, 321_GL_CXXALIAS_RPL (connect, int,
319 (int fd, const struct sockaddr *addr, socklen_t addrlen)); 322 (int fd, const struct sockaddr *addr, socklen_t addrlen));
@@ -326,10 +329,11 @@ _GL_CXXALIAS_SYS_CAST (connect, int,
326# endif 329# endif
327_GL_CXXALIASWARN (connect); 330_GL_CXXALIASWARN (connect);
328#elif @HAVE_WINSOCK2_H@ 331#elif @HAVE_WINSOCK2_H@
329# undef connect 332# if !GNULIB_CONNECT
330# define connect socket_used_without_requesting_gnulib_module_connect 333# undef connect
334# define connect connect_used_without_requesting_gnulib_module_connect
335# endif
331#elif defined GNULIB_POSIXCHECK 336#elif defined GNULIB_POSIXCHECK
332# undef connect
333# if HAVE_RAW_DECL_CONNECT 337# if HAVE_RAW_DECL_CONNECT
334_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - " 338_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
335 "use gnulib module connect for portability"); 339 "use gnulib module connect for portability");
@@ -345,7 +349,7 @@ _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
345_GL_FUNCDECL_RPL (accept, int, 349_GL_FUNCDECL_RPL (accept, int,
346 (int fd, 350 (int fd,
347 struct sockaddr *restrict addr, 351 struct sockaddr *restrict addr,
348 socklen_t *restrict addrlen)); 352 socklen_t *restrict addrlen), );
349_GL_CXXALIAS_RPL (accept, int, 353_GL_CXXALIAS_RPL (accept, int,
350 (int fd, 354 (int fd,
351 struct sockaddr *restrict addr, 355 struct sockaddr *restrict addr,
@@ -362,10 +366,11 @@ _GL_CXXALIAS_SYS_CAST (accept, int,
362_GL_CXXALIASWARN (accept); 366_GL_CXXALIASWARN (accept);
363# endif 367# endif
364#elif @HAVE_WINSOCK2_H@ 368#elif @HAVE_WINSOCK2_H@
365# undef accept 369# if !GNULIB_ACCEPT
366# define accept accept_used_without_requesting_gnulib_module_accept 370# undef accept
371# define accept accept_used_without_requesting_gnulib_module_accept
372# endif
367#elif defined GNULIB_POSIXCHECK 373#elif defined GNULIB_POSIXCHECK
368# undef accept
369# if HAVE_RAW_DECL_ACCEPT 374# if HAVE_RAW_DECL_ACCEPT
370_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - " 375_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
371 "use gnulib module accept for portability"); 376 "use gnulib module accept for portability");
@@ -379,7 +384,7 @@ _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
379# define bind rpl_bind 384# define bind rpl_bind
380# endif 385# endif
381_GL_FUNCDECL_RPL (bind, int, 386_GL_FUNCDECL_RPL (bind, int,
382 (int fd, const struct sockaddr *addr, socklen_t addrlen) 387 (int fd, const struct sockaddr *addr, socklen_t addrlen),
383 _GL_ARG_NONNULL ((2))); 388 _GL_ARG_NONNULL ((2)));
384_GL_CXXALIAS_RPL (bind, int, 389_GL_CXXALIAS_RPL (bind, int,
385 (int fd, const struct sockaddr *addr, socklen_t addrlen)); 390 (int fd, const struct sockaddr *addr, socklen_t addrlen));
@@ -392,10 +397,11 @@ _GL_CXXALIAS_SYS_CAST (bind, int,
392# endif 397# endif
393_GL_CXXALIASWARN (bind); 398_GL_CXXALIASWARN (bind);
394#elif @HAVE_WINSOCK2_H@ 399#elif @HAVE_WINSOCK2_H@
395# undef bind 400# if !GNULIB_BIND
396# define bind bind_used_without_requesting_gnulib_module_bind 401# undef bind
402# define bind bind_used_without_requesting_gnulib_module_bind
403# endif
397#elif defined GNULIB_POSIXCHECK 404#elif defined GNULIB_POSIXCHECK
398# undef bind
399# if HAVE_RAW_DECL_BIND 405# if HAVE_RAW_DECL_BIND
400_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - " 406_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
401 "use gnulib module bind for portability"); 407 "use gnulib module bind for portability");
@@ -410,7 +416,7 @@ _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
410# endif 416# endif
411_GL_FUNCDECL_RPL (getpeername, int, 417_GL_FUNCDECL_RPL (getpeername, int,
412 (int fd, struct sockaddr *restrict addr, 418 (int fd, struct sockaddr *restrict addr,
413 socklen_t *restrict addrlen) 419 socklen_t *restrict addrlen),
414 _GL_ARG_NONNULL ((2, 3))); 420 _GL_ARG_NONNULL ((2, 3)));
415_GL_CXXALIAS_RPL (getpeername, int, 421_GL_CXXALIAS_RPL (getpeername, int,
416 (int fd, struct sockaddr *restrict addr, 422 (int fd, struct sockaddr *restrict addr,
@@ -426,10 +432,11 @@ _GL_CXXALIAS_SYS_CAST (getpeername, int,
426_GL_CXXALIASWARN (getpeername); 432_GL_CXXALIASWARN (getpeername);
427# endif 433# endif
428#elif @HAVE_WINSOCK2_H@ 434#elif @HAVE_WINSOCK2_H@
429# undef getpeername 435# if !GNULIB_GETPEERNAME
430# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername 436# undef getpeername
437# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
438# endif
431#elif defined GNULIB_POSIXCHECK 439#elif defined GNULIB_POSIXCHECK
432# undef getpeername
433# if HAVE_RAW_DECL_GETPEERNAME 440# if HAVE_RAW_DECL_GETPEERNAME
434_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - " 441_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
435 "use gnulib module getpeername for portability"); 442 "use gnulib module getpeername for portability");
@@ -444,7 +451,7 @@ _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
444# endif 451# endif
445_GL_FUNCDECL_RPL (getsockname, int, 452_GL_FUNCDECL_RPL (getsockname, int,
446 (int fd, struct sockaddr *restrict addr, 453 (int fd, struct sockaddr *restrict addr,
447 socklen_t *restrict addrlen) 454 socklen_t *restrict addrlen),
448 _GL_ARG_NONNULL ((2, 3))); 455 _GL_ARG_NONNULL ((2, 3)));
449_GL_CXXALIAS_RPL (getsockname, int, 456_GL_CXXALIAS_RPL (getsockname, int,
450 (int fd, struct sockaddr *restrict addr, 457 (int fd, struct sockaddr *restrict addr,
@@ -460,10 +467,11 @@ _GL_CXXALIAS_SYS_CAST (getsockname, int,
460_GL_CXXALIASWARN (getsockname); 467_GL_CXXALIASWARN (getsockname);
461# endif 468# endif
462#elif @HAVE_WINSOCK2_H@ 469#elif @HAVE_WINSOCK2_H@
463# undef getsockname 470# if !GNULIB_GETSOCKNAME
464# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname 471# undef getsockname
472# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
473# endif
465#elif defined GNULIB_POSIXCHECK 474#elif defined GNULIB_POSIXCHECK
466# undef getsockname
467# if HAVE_RAW_DECL_GETSOCKNAME 475# if HAVE_RAW_DECL_GETSOCKNAME
468_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - " 476_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
469 "use gnulib module getsockname for portability"); 477 "use gnulib module getsockname for portability");
@@ -478,7 +486,7 @@ _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
478# endif 486# endif
479_GL_FUNCDECL_RPL (getsockopt, int, 487_GL_FUNCDECL_RPL (getsockopt, int,
480 (int fd, int level, int optname, 488 (int fd, int level, int optname,
481 void *restrict optval, socklen_t *restrict optlen) 489 void *restrict optval, socklen_t *restrict optlen),
482 _GL_ARG_NONNULL ((4, 5))); 490 _GL_ARG_NONNULL ((4, 5)));
483_GL_CXXALIAS_RPL (getsockopt, int, 491_GL_CXXALIAS_RPL (getsockopt, int,
484 (int fd, int level, int optname, 492 (int fd, int level, int optname,
@@ -492,10 +500,11 @@ _GL_CXXALIAS_SYS_CAST (getsockopt, int,
492# endif 500# endif
493_GL_CXXALIASWARN (getsockopt); 501_GL_CXXALIASWARN (getsockopt);
494#elif @HAVE_WINSOCK2_H@ 502#elif @HAVE_WINSOCK2_H@
495# undef getsockopt 503# if !GNULIB_GETSOCKOPT
496# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt 504# undef getsockopt
505# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
506# endif
497#elif defined GNULIB_POSIXCHECK 507#elif defined GNULIB_POSIXCHECK
498# undef getsockopt
499# if HAVE_RAW_DECL_GETSOCKOPT 508# if HAVE_RAW_DECL_GETSOCKOPT
500_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - " 509_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
501 "use gnulib module getsockopt for portability"); 510 "use gnulib module getsockopt for portability");
@@ -508,17 +517,18 @@ _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
508# undef listen 517# undef listen
509# define listen rpl_listen 518# define listen rpl_listen
510# endif 519# endif
511_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog)); 520_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog), );
512_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog)); 521_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
513# else 522# else
514_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog)); 523_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
515# endif 524# endif
516_GL_CXXALIASWARN (listen); 525_GL_CXXALIASWARN (listen);
517#elif @HAVE_WINSOCK2_H@ 526#elif @HAVE_WINSOCK2_H@
518# undef listen 527# if !GNULIB_LISTEN
519# define listen listen_used_without_requesting_gnulib_module_listen 528# undef listen
529# define listen listen_used_without_requesting_gnulib_module_listen
530# endif
520#elif defined GNULIB_POSIXCHECK 531#elif defined GNULIB_POSIXCHECK
521# undef listen
522# if HAVE_RAW_DECL_LISTEN 532# if HAVE_RAW_DECL_LISTEN
523_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - " 533_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
524 "use gnulib module listen for portability"); 534 "use gnulib module listen for portability");
@@ -531,7 +541,7 @@ _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
531# undef recv 541# undef recv
532# define recv rpl_recv 542# define recv rpl_recv
533# endif 543# endif
534_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags) 544_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags),
535 _GL_ARG_NONNULL ((2))); 545 _GL_ARG_NONNULL ((2)));
536_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)); 546_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
537# else 547# else
@@ -542,10 +552,11 @@ _GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
542# endif 552# endif
543_GL_CXXALIASWARN (recv); 553_GL_CXXALIASWARN (recv);
544#elif @HAVE_WINSOCK2_H@ 554#elif @HAVE_WINSOCK2_H@
545# undef recv 555# if !GNULIB_RECV
546# define recv recv_used_without_requesting_gnulib_module_recv 556# undef recv
557# define recv recv_used_without_requesting_gnulib_module_recv
558# endif
547#elif defined GNULIB_POSIXCHECK 559#elif defined GNULIB_POSIXCHECK
548# undef recv
549# if HAVE_RAW_DECL_RECV 560# if HAVE_RAW_DECL_RECV
550_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - " 561_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
551 "use gnulib module recv for portability"); 562 "use gnulib module recv for portability");
@@ -559,7 +570,7 @@ _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
559# define send rpl_send 570# define send rpl_send
560# endif 571# endif
561_GL_FUNCDECL_RPL (send, ssize_t, 572_GL_FUNCDECL_RPL (send, ssize_t,
562 (int fd, const void *buf, size_t len, int flags) 573 (int fd, const void *buf, size_t len, int flags),
563 _GL_ARG_NONNULL ((2))); 574 _GL_ARG_NONNULL ((2)));
564_GL_CXXALIAS_RPL (send, ssize_t, 575_GL_CXXALIAS_RPL (send, ssize_t,
565 (int fd, const void *buf, size_t len, int flags)); 576 (int fd, const void *buf, size_t len, int flags));
@@ -572,10 +583,11 @@ _GL_CXXALIAS_SYS_CAST (send, ssize_t,
572# endif 583# endif
573_GL_CXXALIASWARN (send); 584_GL_CXXALIASWARN (send);
574#elif @HAVE_WINSOCK2_H@ 585#elif @HAVE_WINSOCK2_H@
575# undef send 586# if !GNULIB_SEND
576# define send send_used_without_requesting_gnulib_module_send 587# undef send
588# define send send_used_without_requesting_gnulib_module_send
589# endif
577#elif defined GNULIB_POSIXCHECK 590#elif defined GNULIB_POSIXCHECK
578# undef send
579# if HAVE_RAW_DECL_SEND 591# if HAVE_RAW_DECL_SEND
580_GL_WARN_ON_USE (send, "send is not always POSIX compliant - " 592_GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
581 "use gnulib module send for portability"); 593 "use gnulib module send for portability");
@@ -591,7 +603,7 @@ _GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
591_GL_FUNCDECL_RPL (recvfrom, ssize_t, 603_GL_FUNCDECL_RPL (recvfrom, ssize_t,
592 (int fd, void *restrict buf, size_t len, int flags, 604 (int fd, void *restrict buf, size_t len, int flags,
593 struct sockaddr *restrict from, 605 struct sockaddr *restrict from,
594 socklen_t *restrict fromlen) 606 socklen_t *restrict fromlen),
595 _GL_ARG_NONNULL ((2))); 607 _GL_ARG_NONNULL ((2)));
596_GL_CXXALIAS_RPL (recvfrom, ssize_t, 608_GL_CXXALIAS_RPL (recvfrom, ssize_t,
597 (int fd, void *restrict buf, size_t len, int flags, 609 (int fd, void *restrict buf, size_t len, int flags,
@@ -609,10 +621,11 @@ _GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
609_GL_CXXALIASWARN (recvfrom); 621_GL_CXXALIASWARN (recvfrom);
610# endif 622# endif
611#elif @HAVE_WINSOCK2_H@ 623#elif @HAVE_WINSOCK2_H@
612# undef recvfrom 624# if !GNULIB_RECVFROM
613# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom 625# undef recvfrom
626# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
627# endif
614#elif defined GNULIB_POSIXCHECK 628#elif defined GNULIB_POSIXCHECK
615# undef recvfrom
616# if HAVE_RAW_DECL_RECVFROM 629# if HAVE_RAW_DECL_RECVFROM
617_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - " 630_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
618 "use gnulib module recvfrom for portability"); 631 "use gnulib module recvfrom for portability");
@@ -627,7 +640,7 @@ _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
627# endif 640# endif
628_GL_FUNCDECL_RPL (sendto, ssize_t, 641_GL_FUNCDECL_RPL (sendto, ssize_t,
629 (int fd, const void *buf, size_t len, int flags, 642 (int fd, const void *buf, size_t len, int flags,
630 const struct sockaddr *to, socklen_t tolen) 643 const struct sockaddr *to, socklen_t tolen),
631 _GL_ARG_NONNULL ((2))); 644 _GL_ARG_NONNULL ((2)));
632_GL_CXXALIAS_RPL (sendto, ssize_t, 645_GL_CXXALIAS_RPL (sendto, ssize_t,
633 (int fd, const void *buf, size_t len, int flags, 646 (int fd, const void *buf, size_t len, int flags,
@@ -641,10 +654,11 @@ _GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
641# endif 654# endif
642_GL_CXXALIASWARN (sendto); 655_GL_CXXALIASWARN (sendto);
643#elif @HAVE_WINSOCK2_H@ 656#elif @HAVE_WINSOCK2_H@
644# undef sendto 657# if !GNULIB_SENDTO
645# define sendto sendto_used_without_requesting_gnulib_module_sendto 658# undef sendto
659# define sendto sendto_used_without_requesting_gnulib_module_sendto
660# endif
646#elif defined GNULIB_POSIXCHECK 661#elif defined GNULIB_POSIXCHECK
647# undef sendto
648# if HAVE_RAW_DECL_SENDTO 662# if HAVE_RAW_DECL_SENDTO
649_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - " 663_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
650 "use gnulib module sendto for portability"); 664 "use gnulib module sendto for portability");
@@ -658,7 +672,7 @@ _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
658# define setsockopt rpl_setsockopt 672# define setsockopt rpl_setsockopt
659# endif 673# endif
660_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname, 674_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
661 const void * optval, socklen_t optlen) 675 const void * optval, socklen_t optlen),
662 _GL_ARG_NONNULL ((4))); 676 _GL_ARG_NONNULL ((4)));
663_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname, 677_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
664 const void * optval, socklen_t optlen)); 678 const void * optval, socklen_t optlen));
@@ -671,10 +685,11 @@ _GL_CXXALIAS_SYS_CAST (setsockopt, int,
671# endif 685# endif
672_GL_CXXALIASWARN (setsockopt); 686_GL_CXXALIASWARN (setsockopt);
673#elif @HAVE_WINSOCK2_H@ 687#elif @HAVE_WINSOCK2_H@
674# undef setsockopt 688# if !GNULIB_SETSOCKOPT
675# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt 689# undef setsockopt
690# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
691# endif
676#elif defined GNULIB_POSIXCHECK 692#elif defined GNULIB_POSIXCHECK
677# undef setsockopt
678# if HAVE_RAW_DECL_SETSOCKOPT 693# if HAVE_RAW_DECL_SETSOCKOPT
679_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - " 694_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
680 "use gnulib module setsockopt for portability"); 695 "use gnulib module setsockopt for portability");
@@ -687,17 +702,18 @@ _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
687# undef shutdown 702# undef shutdown
688# define shutdown rpl_shutdown 703# define shutdown rpl_shutdown
689# endif 704# endif
690_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how)); 705_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how), );
691_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how)); 706_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
692# else 707# else
693_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how)); 708_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
694# endif 709# endif
695_GL_CXXALIASWARN (shutdown); 710_GL_CXXALIASWARN (shutdown);
696#elif @HAVE_WINSOCK2_H@ 711#elif @HAVE_WINSOCK2_H@
697# undef shutdown 712# if !GNULIB_SHUTDOWN
698# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown 713# undef shutdown
714# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
715# endif
699#elif defined GNULIB_POSIXCHECK 716#elif defined GNULIB_POSIXCHECK
700# undef shutdown
701# if HAVE_RAW_DECL_SHUTDOWN 717# if HAVE_RAW_DECL_SHUTDOWN
702_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - " 718_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
703 "use gnulib module shutdown for portability"); 719 "use gnulib module shutdown for portability");
@@ -716,21 +732,20 @@ _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
716# endif 732# endif
717_GL_FUNCDECL_RPL (accept4, int, 733_GL_FUNCDECL_RPL (accept4, int,
718 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 734 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
719 int flags)); 735 int flags), );
720_GL_CXXALIAS_RPL (accept4, int, 736_GL_CXXALIAS_RPL (accept4, int,
721 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 737 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
722 int flags)); 738 int flags));
723# else 739# else
724_GL_FUNCDECL_SYS (accept4, int, 740_GL_FUNCDECL_SYS (accept4, int,
725 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 741 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
726 int flags)); 742 int flags), );
727_GL_CXXALIAS_SYS (accept4, int, 743_GL_CXXALIAS_SYS (accept4, int,
728 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, 744 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
729 int flags)); 745 int flags));
730# endif 746# endif
731_GL_CXXALIASWARN (accept4); 747_GL_CXXALIASWARN (accept4);
732#elif defined GNULIB_POSIXCHECK 748#elif defined GNULIB_POSIXCHECK
733# undef accept4
734# if HAVE_RAW_DECL_ACCEPT4 749# if HAVE_RAW_DECL_ACCEPT4
735_GL_WARN_ON_USE (accept4, "accept4 is unportable - " 750_GL_WARN_ON_USE (accept4, "accept4 is unportable - "
736 "use gnulib module accept4 for portability"); 751 "use gnulib module accept4 for portability");