diff options
Diffstat (limited to 'gl/sys_socket.in.h')
| -rw-r--r-- | gl/sys_socket.in.h | 145 |
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 | ||
| 205 | struct msghdr { | 206 | struct 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 |
| 233 | rpl_fd_isset (SOCKET fd, fd_set * set) | 236 | rpl_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"); |
