1 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
2 and for systems where it is incomplete.
3 Copyright (C) 2005-2016 Free Software Foundation, Inc.
4 Written by Simon Josefsson.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>. */
19 /* This file is supposed to be used on platforms that lack <sys/socket.h>,
20 on platforms where <sys/socket.h> cannot be included standalone, and on
21 platforms where <sys/socket.h> does not provide all necessary definitions.
22 It is intended to provide definitions and prototypes needed by an
26 @PRAGMA_SYSTEM_HEADER@
30 #if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
31 /* Special invocation convention:
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>,
34 and the latter includes <sys/socket.h>. In this situation, the functions
35 are not yet declared, therefore we cannot provide the C++ aliases. */
37 #@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
40 /* Normal invocation convention. */
42 #ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
44 #if @HAVE_SYS_SOCKET_H@
46 # define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
48 /* On many platforms, <sys/socket.h> assumes prior inclusion of
50 # include <sys/types.h>
52 /* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL
56 /* The include_next requires a split double-inclusion guard. */
57 # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
59 # undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
63 #ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
64 #define _@GUARD_PREFIX@_SYS_SOCKET_H
66 #ifndef _GL_INLINE_HEADER_BEGIN
67 #error "Please include config.h first."
69 _GL_INLINE_HEADER_BEGIN
70 #ifndef _GL_SYS_SOCKET_INLINE
71 # define _GL_SYS_SOCKET_INLINE _GL_INLINE
74 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
76 /* The definition of _GL_ARG_NONNULL is copied here. */
78 /* The definition of _GL_WARN_ON_USE is copied here. */
80 #if !@HAVE_SA_FAMILY_T@
81 # if !GNULIB_defined_sa_family_t
82 typedef unsigned short sa_family_t
;
83 # define GNULIB_defined_sa_family_t 1
87 #if @HAVE_STRUCT_SOCKADDR_STORAGE@
88 /* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1. */
89 # if !@HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
91 # define ss_family __ss_family
95 # include <stdalign.h>
96 /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
97 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
98 # define __ss_aligntype unsigned long int
100 # define _SS_PADSIZE \
101 (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
102 ? sizeof (sa_family_t) \
103 : alignof (__ss_aligntype)) \
104 + sizeof (__ss_aligntype)))
106 # if !GNULIB_defined_struct_sockaddr_storage
107 struct sockaddr_storage
109 sa_family_t ss_family
; /* Address family, etc. */
110 __ss_aligntype __ss_align
; /* Force desired alignment. */
111 char __ss_padding
[_SS_PADSIZE
];
113 # define GNULIB_defined_struct_sockaddr_storage 1
118 /* Get struct iovec. */
119 /* But avoid namespace pollution on glibc systems. */
120 #if ! defined __GLIBC__
121 # include <sys/uio.h>
124 #if @HAVE_SYS_SOCKET_H@
126 /* A platform that has <sys/socket.h>. */
128 /* For shutdown(). */
129 # if !defined SHUT_RD
132 # if !defined SHUT_WR
135 # if !defined SHUT_RDWR
142 # error "Cygwin does have a sys/socket.h, doesn't it?!?"
145 /* A platform that lacks <sys/socket.h>.
147 Currently only MinGW is supported. See the gnulib manual regarding
148 Windows sockets. MinGW has the header files winsock2.h and
149 ws2tcpip.h that declare the sys/socket.h definitions we need. Note
150 that you can influence which definitions you get by setting the
151 WINVER symbol before including these two files. For example,
152 getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
153 symbol is set indirectly through WINVER). You can set this by
154 adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
155 code may not run on older Windows releases then. My Windows 2000
156 box was not able to run the code, for example. The situation is
157 slightly confusing because
158 <http://msdn.microsoft.com/en-us/library/ms738520>
159 suggests that getaddrinfo should be available on all Windows
162 # if @HAVE_WINSOCK2_H@
163 # include <winsock2.h>
165 # if @HAVE_WS2TCPIP_H@
166 # include <ws2tcpip.h>
169 /* For shutdown(). */
170 # if !defined SHUT_RD && defined SD_RECEIVE
171 # define SHUT_RD SD_RECEIVE
173 # if !defined SHUT_WR && defined SD_SEND
174 # define SHUT_WR SD_SEND
176 # if !defined SHUT_RDWR && defined SD_BOTH
177 # define SHUT_RDWR SD_BOTH
180 # if @HAVE_WINSOCK2_H@
181 /* Include headers needed by the emulation code. */
182 # include <sys/types.h>
185 # if !GNULIB_defined_socklen_t
186 typedef int socklen_t
;
187 # define GNULIB_defined_socklen_t 1
192 /* Rudimentary 'struct msghdr'; this works as long as you don't try to
193 access msg_control or msg_controllen. */
196 socklen_t msg_namelen
;
197 struct iovec
*msg_iov
;
204 /* Fix some definitions from <winsock2.h>. */
206 #if @HAVE_WINSOCK2_H@
208 # if !GNULIB_defined_rpl_fd_isset
210 /* Re-define FD_ISSET to avoid a WSA call while we are not using
212 _GL_SYS_SOCKET_INLINE
int
213 rpl_fd_isset (SOCKET fd
, fd_set
* set
)
219 for (i
= 0; i
< set
->fd_count
; i
++)
220 if (set
->fd_array
[i
] == fd
)
226 # define GNULIB_defined_rpl_fd_isset 1
230 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
234 /* Hide some function declarations from <winsock2.h>. */
236 #if @HAVE_WINSOCK2_H@
237 # if !defined _@GUARD_PREFIX@_UNISTD_H
238 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
240 # define close close_used_without_including_unistd_h
242 _GL_WARN_ON_USE (close
,
243 "close() used without including <unistd.h>");
245 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
247 # define gethostname gethostname_used_without_including_unistd_h
249 _GL_WARN_ON_USE (gethostname
,
250 "gethostname() used without including <unistd.h>");
253 # if !defined _@GUARD_PREFIX@_SYS_SELECT_H
254 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
256 # define select select_used_without_including_sys_select_h
258 _GL_WARN_ON_USE (select
,
259 "select() used without including <sys/select.h>");
264 /* Wrap everything else to use libc file descriptors for sockets. */
267 # if @HAVE_WINSOCK2_H@
268 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
270 # define socket rpl_socket
272 _GL_FUNCDECL_RPL (socket
, int, (int domain
, int type
, int protocol
));
273 _GL_CXXALIAS_RPL (socket
, int, (int domain
, int type
, int protocol
));
275 _GL_CXXALIAS_SYS (socket
, int, (int domain
, int type
, int protocol
));
277 _GL_CXXALIASWARN (socket
);
278 #elif @HAVE_WINSOCK2_H@
280 # define socket socket_used_without_requesting_gnulib_module_socket
281 #elif defined GNULIB_POSIXCHECK
283 # if HAVE_RAW_DECL_SOCKET
284 _GL_WARN_ON_USE (socket
, "socket is not always POSIX compliant - "
285 "use gnulib module socket for portability");
290 # if @HAVE_WINSOCK2_H@
291 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
293 # define connect rpl_connect
295 _GL_FUNCDECL_RPL (connect
, int,
296 (int fd
, const struct sockaddr
*addr
, socklen_t addrlen
)
297 _GL_ARG_NONNULL ((2)));
298 _GL_CXXALIAS_RPL (connect
, int,
299 (int fd
, const struct sockaddr
*addr
, socklen_t addrlen
));
301 /* Need to cast, because on NonStop Kernel, the third parameter is
303 _GL_CXXALIAS_SYS_CAST (connect
, int,
305 const struct sockaddr
*addr
, socklen_t addrlen
));
307 _GL_CXXALIASWARN (connect
);
308 #elif @HAVE_WINSOCK2_H@
310 # define connect socket_used_without_requesting_gnulib_module_connect
311 #elif defined GNULIB_POSIXCHECK
313 # if HAVE_RAW_DECL_CONNECT
314 _GL_WARN_ON_USE (connect
, "connect is not always POSIX compliant - "
315 "use gnulib module connect for portability");
320 # if @HAVE_WINSOCK2_H@
321 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
323 # define accept rpl_accept
325 _GL_FUNCDECL_RPL (accept
, int,
326 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
327 _GL_CXXALIAS_RPL (accept
, int,
328 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
330 /* Need to cast, because on Solaris 10 systems, the third parameter is
332 _GL_CXXALIAS_SYS_CAST (accept
, int,
333 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
335 _GL_CXXALIASWARN (accept
);
336 #elif @HAVE_WINSOCK2_H@
338 # define accept accept_used_without_requesting_gnulib_module_accept
339 #elif defined GNULIB_POSIXCHECK
341 # if HAVE_RAW_DECL_ACCEPT
342 _GL_WARN_ON_USE (accept
, "accept is not always POSIX compliant - "
343 "use gnulib module accept for portability");
348 # if @HAVE_WINSOCK2_H@
349 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
351 # define bind rpl_bind
353 _GL_FUNCDECL_RPL (bind
, int,
354 (int fd
, const struct sockaddr
*addr
, socklen_t addrlen
)
355 _GL_ARG_NONNULL ((2)));
356 _GL_CXXALIAS_RPL (bind
, int,
357 (int fd
, const struct sockaddr
*addr
, socklen_t addrlen
));
359 /* Need to cast, because on NonStop Kernel, the third parameter is
361 _GL_CXXALIAS_SYS_CAST (bind
, int,
363 const struct sockaddr
*addr
, socklen_t addrlen
));
365 _GL_CXXALIASWARN (bind
);
366 #elif @HAVE_WINSOCK2_H@
368 # define bind bind_used_without_requesting_gnulib_module_bind
369 #elif defined GNULIB_POSIXCHECK
371 # if HAVE_RAW_DECL_BIND
372 _GL_WARN_ON_USE (bind
, "bind is not always POSIX compliant - "
373 "use gnulib module bind for portability");
377 #if @GNULIB_GETPEERNAME@
378 # if @HAVE_WINSOCK2_H@
379 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
381 # define getpeername rpl_getpeername
383 _GL_FUNCDECL_RPL (getpeername
, int,
384 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
)
385 _GL_ARG_NONNULL ((2, 3)));
386 _GL_CXXALIAS_RPL (getpeername
, int,
387 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
389 /* Need to cast, because on Solaris 10 systems, the third parameter is
391 _GL_CXXALIAS_SYS_CAST (getpeername
, int,
392 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
394 _GL_CXXALIASWARN (getpeername
);
395 #elif @HAVE_WINSOCK2_H@
397 # define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
398 #elif defined GNULIB_POSIXCHECK
400 # if HAVE_RAW_DECL_GETPEERNAME
401 _GL_WARN_ON_USE (getpeername
, "getpeername is not always POSIX compliant - "
402 "use gnulib module getpeername for portability");
406 #if @GNULIB_GETSOCKNAME@
407 # if @HAVE_WINSOCK2_H@
408 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
410 # define getsockname rpl_getsockname
412 _GL_FUNCDECL_RPL (getsockname
, int,
413 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
)
414 _GL_ARG_NONNULL ((2, 3)));
415 _GL_CXXALIAS_RPL (getsockname
, int,
416 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
418 /* Need to cast, because on Solaris 10 systems, the third parameter is
420 _GL_CXXALIAS_SYS_CAST (getsockname
, int,
421 (int fd
, struct sockaddr
*addr
, socklen_t
*addrlen
));
423 _GL_CXXALIASWARN (getsockname
);
424 #elif @HAVE_WINSOCK2_H@
426 # define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
427 #elif defined GNULIB_POSIXCHECK
429 # if HAVE_RAW_DECL_GETSOCKNAME
430 _GL_WARN_ON_USE (getsockname
, "getsockname is not always POSIX compliant - "
431 "use gnulib module getsockname for portability");
435 #if @GNULIB_GETSOCKOPT@
436 # if @HAVE_WINSOCK2_H@
437 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
439 # define getsockopt rpl_getsockopt
441 _GL_FUNCDECL_RPL (getsockopt
, int, (int fd
, int level
, int optname
,
442 void *optval
, socklen_t
*optlen
)
443 _GL_ARG_NONNULL ((4, 5)));
444 _GL_CXXALIAS_RPL (getsockopt
, int, (int fd
, int level
, int optname
,
445 void *optval
, socklen_t
*optlen
));
447 /* Need to cast, because on Solaris 10 systems, the fifth parameter is
449 _GL_CXXALIAS_SYS_CAST (getsockopt
, int, (int fd
, int level
, int optname
,
450 void *optval
, socklen_t
*optlen
));
452 _GL_CXXALIASWARN (getsockopt
);
453 #elif @HAVE_WINSOCK2_H@
455 # define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
456 #elif defined GNULIB_POSIXCHECK
458 # if HAVE_RAW_DECL_GETSOCKOPT
459 _GL_WARN_ON_USE (getsockopt
, "getsockopt is not always POSIX compliant - "
460 "use gnulib module getsockopt for portability");
465 # if @HAVE_WINSOCK2_H@
466 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
468 # define listen rpl_listen
470 _GL_FUNCDECL_RPL (listen
, int, (int fd
, int backlog
));
471 _GL_CXXALIAS_RPL (listen
, int, (int fd
, int backlog
));
473 _GL_CXXALIAS_SYS (listen
, int, (int fd
, int backlog
));
475 _GL_CXXALIASWARN (listen
);
476 #elif @HAVE_WINSOCK2_H@
478 # define listen listen_used_without_requesting_gnulib_module_listen
479 #elif defined GNULIB_POSIXCHECK
481 # if HAVE_RAW_DECL_LISTEN
482 _GL_WARN_ON_USE (listen
, "listen is not always POSIX compliant - "
483 "use gnulib module listen for portability");
488 # if @HAVE_WINSOCK2_H@
489 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
491 # define recv rpl_recv
493 _GL_FUNCDECL_RPL (recv
, ssize_t
, (int fd
, void *buf
, size_t len
, int flags
)
494 _GL_ARG_NONNULL ((2)));
495 _GL_CXXALIAS_RPL (recv
, ssize_t
, (int fd
, void *buf
, size_t len
, int flags
));
497 _GL_CXXALIAS_SYS (recv
, ssize_t
, (int fd
, void *buf
, size_t len
, int flags
));
499 _GL_CXXALIASWARN (recv
);
500 #elif @HAVE_WINSOCK2_H@
502 # define recv recv_used_without_requesting_gnulib_module_recv
503 #elif defined GNULIB_POSIXCHECK
505 # if HAVE_RAW_DECL_RECV
506 _GL_WARN_ON_USE (recv
, "recv is not always POSIX compliant - "
507 "use gnulib module recv for portability");
512 # if @HAVE_WINSOCK2_H@
513 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
515 # define send rpl_send
517 _GL_FUNCDECL_RPL (send
, ssize_t
,
518 (int fd
, const void *buf
, size_t len
, int flags
)
519 _GL_ARG_NONNULL ((2)));
520 _GL_CXXALIAS_RPL (send
, ssize_t
,
521 (int fd
, const void *buf
, size_t len
, int flags
));
523 _GL_CXXALIAS_SYS (send
, ssize_t
,
524 (int fd
, const void *buf
, size_t len
, int flags
));
526 _GL_CXXALIASWARN (send
);
527 #elif @HAVE_WINSOCK2_H@
529 # define send send_used_without_requesting_gnulib_module_send
530 #elif defined GNULIB_POSIXCHECK
532 # if HAVE_RAW_DECL_SEND
533 _GL_WARN_ON_USE (send
, "send is not always POSIX compliant - "
534 "use gnulib module send for portability");
538 #if @GNULIB_RECVFROM@
539 # if @HAVE_WINSOCK2_H@
540 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
542 # define recvfrom rpl_recvfrom
544 _GL_FUNCDECL_RPL (recvfrom
, ssize_t
,
545 (int fd
, void *buf
, size_t len
, int flags
,
546 struct sockaddr
*from
, socklen_t
*fromlen
)
547 _GL_ARG_NONNULL ((2)));
548 _GL_CXXALIAS_RPL (recvfrom
, ssize_t
,
549 (int fd
, void *buf
, size_t len
, int flags
,
550 struct sockaddr
*from
, socklen_t
*fromlen
));
552 /* Need to cast, because on Solaris 10 systems, the sixth parameter is
554 _GL_CXXALIAS_SYS_CAST (recvfrom
, ssize_t
,
555 (int fd
, void *buf
, size_t len
, int flags
,
556 struct sockaddr
*from
, socklen_t
*fromlen
));
558 _GL_CXXALIASWARN (recvfrom
);
559 #elif @HAVE_WINSOCK2_H@
561 # define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
562 #elif defined GNULIB_POSIXCHECK
564 # if HAVE_RAW_DECL_RECVFROM
565 _GL_WARN_ON_USE (recvfrom
, "recvfrom is not always POSIX compliant - "
566 "use gnulib module recvfrom for portability");
571 # if @HAVE_WINSOCK2_H@
572 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
574 # define sendto rpl_sendto
576 _GL_FUNCDECL_RPL (sendto
, ssize_t
,
577 (int fd
, const void *buf
, size_t len
, int flags
,
578 const struct sockaddr
*to
, socklen_t tolen
)
579 _GL_ARG_NONNULL ((2)));
580 _GL_CXXALIAS_RPL (sendto
, ssize_t
,
581 (int fd
, const void *buf
, size_t len
, int flags
,
582 const struct sockaddr
*to
, socklen_t tolen
));
584 /* Need to cast, because on NonStop Kernel, the sixth parameter is
586 _GL_CXXALIAS_SYS_CAST (sendto
, ssize_t
,
587 (int fd
, const void *buf
, size_t len
, int flags
,
588 const struct sockaddr
*to
, socklen_t tolen
));
590 _GL_CXXALIASWARN (sendto
);
591 #elif @HAVE_WINSOCK2_H@
593 # define sendto sendto_used_without_requesting_gnulib_module_sendto
594 #elif defined GNULIB_POSIXCHECK
596 # if HAVE_RAW_DECL_SENDTO
597 _GL_WARN_ON_USE (sendto
, "sendto is not always POSIX compliant - "
598 "use gnulib module sendto for portability");
602 #if @GNULIB_SETSOCKOPT@
603 # if @HAVE_WINSOCK2_H@
604 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
606 # define setsockopt rpl_setsockopt
608 _GL_FUNCDECL_RPL (setsockopt
, int, (int fd
, int level
, int optname
,
609 const void * optval
, socklen_t optlen
)
610 _GL_ARG_NONNULL ((4)));
611 _GL_CXXALIAS_RPL (setsockopt
, int, (int fd
, int level
, int optname
,
612 const void * optval
, socklen_t optlen
));
614 /* Need to cast, because on NonStop Kernel, the fifth parameter is
616 _GL_CXXALIAS_SYS_CAST (setsockopt
, int,
617 (int fd
, int level
, int optname
,
618 const void * optval
, socklen_t optlen
));
620 _GL_CXXALIASWARN (setsockopt
);
621 #elif @HAVE_WINSOCK2_H@
623 # define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
624 #elif defined GNULIB_POSIXCHECK
626 # if HAVE_RAW_DECL_SETSOCKOPT
627 _GL_WARN_ON_USE (setsockopt
, "setsockopt is not always POSIX compliant - "
628 "use gnulib module setsockopt for portability");
632 #if @GNULIB_SHUTDOWN@
633 # if @HAVE_WINSOCK2_H@
634 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
636 # define shutdown rpl_shutdown
638 _GL_FUNCDECL_RPL (shutdown
, int, (int fd
, int how
));
639 _GL_CXXALIAS_RPL (shutdown
, int, (int fd
, int how
));
641 _GL_CXXALIAS_SYS (shutdown
, int, (int fd
, int how
));
643 _GL_CXXALIASWARN (shutdown
);
644 #elif @HAVE_WINSOCK2_H@
646 # define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
647 #elif defined GNULIB_POSIXCHECK
649 # if HAVE_RAW_DECL_SHUTDOWN
650 _GL_WARN_ON_USE (shutdown
, "shutdown is not always POSIX compliant - "
651 "use gnulib module shutdown for portability");
656 /* Accept a connection on a socket, with specific opening flags.
657 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
658 and O_TEXT, O_BINARY (defined in "binary-io.h").
659 See also the Linux man page at
660 <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
662 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
663 # define accept4 rpl_accept4
665 _GL_FUNCDECL_RPL (accept4
, int,
666 (int sockfd
, struct sockaddr
*addr
, socklen_t
*addrlen
,
668 _GL_CXXALIAS_RPL (accept4
, int,
669 (int sockfd
, struct sockaddr
*addr
, socklen_t
*addrlen
,
672 _GL_FUNCDECL_SYS (accept4
, int,
673 (int sockfd
, struct sockaddr
*addr
, socklen_t
*addrlen
,
675 _GL_CXXALIAS_SYS (accept4
, int,
676 (int sockfd
, struct sockaddr
*addr
, socklen_t
*addrlen
,
679 _GL_CXXALIASWARN (accept4
);
680 #elif defined GNULIB_POSIXCHECK
682 # if HAVE_RAW_DECL_ACCEPT4
683 _GL_WARN_ON_USE (accept4
, "accept4 is unportable - "
684 "use gnulib module accept4 for portability");
688 _GL_INLINE_HEADER_END
690 #endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
691 #endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */