annotate lib/sys_socket.in.h @ 12766:2c14f1e449e5

warn-on-use: use instead of link-warning Each *.in.h file serves two purposes - provide enough self-contained content to serve as a replacement for the system header regardless of the user's compiler, and offer the developer the ability to detect any gnulib modules that might have been inadvertantly excluded. The former requires independence from config.h, and routes everything through a Makefile.am snippet that uses @@ substitution specific to the modules that were in use, with details learned at configure time. The latter works by poisoning anything that gnulib did not replace, but which the developer had natively available, explaining why their tests passed during development. Poisoning relies on gcc features, and requires manual triggering by adding -DGNULIB_POSIXCHECK to CFLAGS; it assumes that <config.h> is properly included. In fact, we do not want to use @@ substitution for HAVE_DECL_* during poisoning, because the warning is only relevant for the gnulib modules which were not included, and thus where the m4 macros to set proper @@ values have not been run. Furthermore, we only need to poison interfaces that already have a declaration; if something is not declared, then the developer wouldn't have been able to link, so their code won't be using the problematic interface in the first place. * modules/stdio (Depends-on, Makefile.am): Drop link-warning. * modules/unistd (Depends-on, Makefile.am): Likewise. * modules/arpa_inet (Depends-on): Replace link-warning with warn-on-use. (Makefile.am): Update rules accordingly. * modules/ctype (Depends-on, Makefile.am): Likewise. * modules/dirent (Depends-on, Makefile.am): Likewise. * modules/fcntl-h (Depends-on, Makefile.am): Likewise. * modules/inttypes (Depends-on, Makefile.am): Likewise. * modules/langinfo (Depends-on, Makefile.am): Likewise. * modules/locale (Depends-on, Makefile.am): Likewise. * modules/math (Depends-on, Makefile.am): Likewise. * modules/search (Depends-on, Makefile.am): Likewise. * modules/signal (Depends-on, Makefile.am): Likewise. * modules/spawn (Depends-on, Makefile.am): Likewise. * modules/stdlib (Depends-on, Makefile.am): Likewise. * modules/string (Depends-on, Makefile.am): Likewise. * modules/strings (Depends-on, Makefile.am): Likewise. * modules/sys_file (Depends-on, Makefile.am): Likewise. * modules/sys_ioctl (Depends-on, Makefile.am): Likewise. * modules/sys_select (Depends-on, Makefile.am): Likewise. * modules/sys_socket (Depends-on, Makefile.am): Likewise. * modules/sys_stat (Depends-on, Makefile.am): Likewise. * modules/sys_times (Depends-on, Makefile.am): Likewise. * modules/sys_utsname (Depends-on, Makefile.am): Likewise. * modules/wchar (Depends-on, Makefile.am): Likewise. * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Check which functions should be poisoned. * m4/ctype.m4 (gl_CTYPE_H): Likewise. * m4/dirent_h.m4 (gl_DIRENT_H): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H): Likewise. * m4/inttypes.m4 (gl_INTTYPES_H): Likewise. * m4/langinfo_h.m4 (gl_LANGINFO_H): Likewise. * m4/locale_h.m4 (gl_LOCALE_H): Likewise. * m4/math_h.m4 (gl_MATH_H): Likewise. * m4/search_h.m4 (gl_SEARCH_H): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H): Likewise. * m4/spawn_h.m4 (gl_SPAWN_H): Likewise. * m4/stdio_h.m4 (gl_STDIO_H): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_BODY): Likewise. * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H_DEFAULTS): Likewise. * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise. * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise. * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise. * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise. * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H): Likewise. * m4/wchar.m4 (gl_WCHAR_H): Likewise. * lib/arpa_inet.in.h: Use _GL_WARN_ON_USE instead of GL_LINK_WARNING. * lib/ctype.in.h: Likewise. * lib/dirent.in.h: Likewise. * lib/fcntl.in.h: Likewise. * lib/inttypes.in.h: Likewise. * lib/langinfo.in.h: Likewise. * lib/locale.in.h: Likewise. * lib/math.in.h: Likewise. * lib/search.in.h: Likewise. * lib/signal.in.h: Likewise. * lib/spawn.in.h: Likewise. * lib/stdio.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/string.in.h: Likewise. * lib/strings.in.h: Likewise. * lib/sys_file.in.h: Likewise. * lib/sys_ioctl.in.h: Likewise. * lib/sys_select.in.h: Likewise. * lib/sys_socket.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_times.in.h: Likewise. * lib/sys_utsname.in.h: Likewise. * lib/unistd.in.h: Likewise. * lib/wchar.in.h: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Wed, 16 Dec 2009 16:20:28 -0700
parents c2cbabec01dd
children 64fcd5e219fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9907
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
1 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
2 and for systems where it is incomplete.
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12422
diff changeset
3 Copyright (C) 2005-2010 Free Software Foundation, Inc.
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 Written by Simon Josefsson.
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 This program is free software; you can redistribute it and/or modify
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 any later version.
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 GNU General Public License for more details.
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 along with this program; if not, write to the Free Software Foundation,
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
9907
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
20 /* This file is supposed to be used on platforms that lack <sys/socket.h>,
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
21 on platforms where <sys/socket.h> cannot be included standalone, and on
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
22 platforms where <sys/socket.h> does not provide all necessary definitions.
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 It is intended to provide definitions and prototypes needed by an
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 application. */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #ifndef _GL_SYS_SOCKET_H
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #if @HAVE_SYS_SOCKET_H@
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
10655
8668b19a7032 Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents: 10624
diff changeset
30 # if __GNUC__ >= 3
10375
f96e845fc36d Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 9992
diff changeset
31 @PRAGMA_SYSTEM_HEADER@
10655
8668b19a7032 Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents: 10624
diff changeset
32 # endif
10375
f96e845fc36d Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 9992
diff changeset
33
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 /* On many platforms, <sys/socket.h> assumes prior inclusion of
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 <sys/types.h>. */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 # include <sys/types.h>
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 /* The include_next requires a split double-inclusion guard. */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 #endif
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 #ifndef _GL_SYS_SOCKET_H
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 #define _GL_SYS_SOCKET_H
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
46 /* The definition of _GL_ARG_NONNULL is copied here. */
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
47
11577
40afcbcc19ed sys_socket: MinGW and IRIX does not have sa_family_t type.
Simon Josefsson <simon@josefsson.org>
parents: 11559
diff changeset
48 #if !@HAVE_SA_FAMILY_T@
40afcbcc19ed sys_socket: MinGW and IRIX does not have sa_family_t type.
Simon Josefsson <simon@josefsson.org>
parents: 11559
diff changeset
49 typedef unsigned short sa_family_t;
40afcbcc19ed sys_socket: MinGW and IRIX does not have sa_family_t type.
Simon Josefsson <simon@josefsson.org>
parents: 11559
diff changeset
50 #endif
40afcbcc19ed sys_socket: MinGW and IRIX does not have sa_family_t type.
Simon Josefsson <simon@josefsson.org>
parents: 11559
diff changeset
51
11555
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
52 #if !@HAVE_STRUCT_SOCKADDR_STORAGE@
11559
b7f5d7ba4651 Don't use undefined macro 'max'.
Bruno Haible <bruno@clisp.org>
parents: 11555
diff changeset
53 # include <alignof.h>
11555
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
54 /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
55 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
11559
b7f5d7ba4651 Don't use undefined macro 'max'.
Bruno Haible <bruno@clisp.org>
parents: 11555
diff changeset
56 # define __ss_aligntype unsigned long int
b7f5d7ba4651 Don't use undefined macro 'max'.
Bruno Haible <bruno@clisp.org>
parents: 11555
diff changeset
57 # define _SS_SIZE 256
b7f5d7ba4651 Don't use undefined macro 'max'.
Bruno Haible <bruno@clisp.org>
parents: 11555
diff changeset
58 # define _SS_PADSIZE \
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
59 (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
60 ? sizeof (sa_family_t) \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
61 : alignof (__ss_aligntype)) \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
62 + sizeof (__ss_aligntype)))
11555
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
63
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
64 struct sockaddr_storage
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
65 {
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
66 sa_family_t ss_family; /* Address family, etc. */
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
67 __ss_aligntype __ss_align; /* Force desired alignment. */
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
68 char __ss_padding[_SS_PADSIZE];
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
69 };
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
70 #endif
7612308943f7 sys_socket: Define sockaddr_storage.
Simon Josefsson <simon@josefsson.org>
parents: 11250
diff changeset
71
9907
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
72 #if @HAVE_SYS_SOCKET_H@
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
73
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
74 /* A platform that has <sys/socket.h>. */
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
75
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
76 /* For shutdown(). */
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
77 # if !defined SHUT_RD
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
78 # define SHUT_RD 0
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
79 # endif
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
80 # if !defined SHUT_WR
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
81 # define SHUT_WR 1
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
82 # endif
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
83 # if !defined SHUT_RDWR
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
84 # define SHUT_RDWR 2
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
85 # endif
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
86
be905220886f Override <sys/socket.h> when it exists but is incomplete.
Bruno Haible <bruno@clisp.org>
parents: 9266
diff changeset
87 #else
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
89 # ifdef __CYGWIN__
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
90 # error "Cygwin does have a sys/socket.h, doesn't it?!?"
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
91 # endif
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
92
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 /* A platform that lacks <sys/socket.h>.
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 Currently only MinGW is supported. See the gnulib manual regarding
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 Windows sockets. MinGW has the header files winsock2.h and
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 ws2tcpip.h that declare the sys/socket.h definitions we need. Note
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 that you can influence which definitions you get by setting the
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 WINVER symbol before including these two files. For example,
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 symbol is set indiriectly through WINVER). You can set this by
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 code may not run on older Windows releases then. My Windows 2000
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 box was not able to run the code, for example. The situation is
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 slightly confusing because:
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 suggests that getaddrinfo should be available on all Windows
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 releases. */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 # if @HAVE_WINSOCK2_H@
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 # include <winsock2.h>
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 # endif
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 # if @HAVE_WS2TCPIP_H@
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 # include <ws2tcpip.h>
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 # endif
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 /* For shutdown(). */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 # if !defined SHUT_RD && defined SD_RECEIVE
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 # define SHUT_RD SD_RECEIVE
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 # endif
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 # if !defined SHUT_WR && defined SD_SEND
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 # define SHUT_WR SD_SEND
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 # endif
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 # if !defined SHUT_RDWR && defined SD_BOTH
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 # define SHUT_RDWR SD_BOTH
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 # endif
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
129 /* The definition of _GL_WARN_ON_USE is copied here. */
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
130
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
131 # if @HAVE_WINSOCK2_H@
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
132 /* Include headers needed by the emulation code. */
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
133 # include <sys/types.h>
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
134 # include <io.h>
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
135
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
136 typedef int socklen_t;
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
137
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
138 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
139
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
140 # ifdef __cplusplus
10539
affb655993ea Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 10474
diff changeset
141 extern "C" {
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
142 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
143
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
144 # if @HAVE_WINSOCK2_H@
10539
affb655993ea Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 10474
diff changeset
145
10562
ebbb50a36a9f remove trailing spaces
Jim Meyering <meyering@redhat.com>
parents: 10539
diff changeset
146 /* Re-define FD_ISSET to avoid a WSA call while we are not using
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
147 network sockets. */
9966
2efe37d5c70d Make setsockopt replacement more typesafe.
Simon Josefsson <simon@josefsson.org>
parents: 9962
diff changeset
148 static inline int
10701
8666d9b0d37a lib/sys_socket.in.h (FD_ISSET): Fix warnings under mingw.
Simon Josefsson <simon@josefsson.org>
parents: 10693
diff changeset
149 rpl_fd_isset (SOCKET fd, fd_set * set)
9966
2efe37d5c70d Make setsockopt replacement more typesafe.
Simon Josefsson <simon@josefsson.org>
parents: 9962
diff changeset
150 {
10701
8666d9b0d37a lib/sys_socket.in.h (FD_ISSET): Fix warnings under mingw.
Simon Josefsson <simon@josefsson.org>
parents: 10693
diff changeset
151 u_int i;
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
152 if (set == NULL)
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
153 return 0;
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
154
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
155 for (i = 0; i < set->fd_count; i++)
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
156 if (set->fd_array[i] == fd)
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
157 return 1;
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
158
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
159 return 0;
9966
2efe37d5c70d Make setsockopt replacement more typesafe.
Simon Josefsson <simon@josefsson.org>
parents: 9962
diff changeset
160 }
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
161
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
162 # undef FD_ISSET
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
163 # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
164
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
165 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
166
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
167 /* Wrap everything else to use libc file descriptors for sockets. */
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
168
10610
9202c6340cce Combine the two replacements of 'close'.
Paolo Bonzini <bonzini@gnu.org>
parents: 10594
diff changeset
169 # if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
170 # undef close
10610
9202c6340cce Combine the two replacements of 'close'.
Paolo Bonzini <bonzini@gnu.org>
parents: 10594
diff changeset
171 # define close close_used_without_including_unistd_h
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
172 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
173
10716
16c473421488 Override the gethostname() declaration on native Windows systems.
Bruno Haible <bruno@clisp.org>
parents: 10714
diff changeset
174 # if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
16c473421488 Override the gethostname() declaration on native Windows systems.
Bruno Haible <bruno@clisp.org>
parents: 10714
diff changeset
175 # undef gethostname
16c473421488 Override the gethostname() declaration on native Windows systems.
Bruno Haible <bruno@clisp.org>
parents: 10714
diff changeset
176 # define gethostname gethostname_used_without_including_unistd_h
16c473421488 Override the gethostname() declaration on native Windows systems.
Bruno Haible <bruno@clisp.org>
parents: 10714
diff changeset
177 # endif
16c473421488 Override the gethostname() declaration on native Windows systems.
Bruno Haible <bruno@clisp.org>
parents: 10714
diff changeset
178
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
179 # if @GNULIB_SOCKET@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
180 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
181 # undef socket
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
182 # define socket rpl_socket
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
183 extern int rpl_socket (int, int, int protocol);
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
184 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
185 # elif @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
186 # undef socket
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
187 # define socket socket_used_without_requesting_gnulib_module_socket
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
188 # elif defined GNULIB_POSIXCHECK
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
189 # undef socket
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
190 # if HAVE_RAW_DECL_SOCKET
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
191 _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
192 "use gnulib module socket for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
193 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
194 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
195
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
196 # if @GNULIB_CONNECT@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
197 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
198 # undef connect
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
199 # define connect rpl_connect
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
200 extern int rpl_connect (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
201 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
202 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
203 # undef connect
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
204 # define connect socket_used_without_requesting_gnulib_module_connect
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
205 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
206 # undef connect
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
207 # if HAVE_RAW_DECL_CONNECT
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
208 _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
209 "use gnulib module connect for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
210 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
211 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
212
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
213 # if @GNULIB_ACCEPT@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
214 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
215 # undef accept
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
216 # define accept rpl_accept
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
217 extern int rpl_accept (int, struct sockaddr *, int *);
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
218 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
219 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
220 # undef accept
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
221 # define accept accept_used_without_requesting_gnulib_module_accept
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
222 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
223 # undef accept
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
224 # if HAVE_RAW_DECL_ACCEPT
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
225 _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
226 "use gnulib module accept for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
227 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
228 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
229
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
230 # if @GNULIB_BIND@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
231 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
232 # undef bind
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
233 # define bind rpl_bind
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
234 extern int rpl_bind (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
235 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
236 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
237 # undef bind
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
238 # define bind bind_used_without_requesting_gnulib_module_bind
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
239 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
240 # undef bind
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
241 # if HAVE_RAW_DECL_BIND
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
242 _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
243 "use gnulib module bind for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
244 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
245 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
246
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
247 # if @GNULIB_GETPEERNAME@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
248 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
249 # undef getpeername
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
250 # define getpeername rpl_getpeername
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
251 extern int rpl_getpeername (int, struct sockaddr *, int *)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
252 _GL_ARG_NONNULL ((2, 3));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
253 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
254 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
255 # undef getpeername
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
256 # define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
257 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
258 # undef getpeername
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
259 # if HAVE_RAW_DECL_GETPEERNAME
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
260 _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
261 "use gnulib module getpeername for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
262 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
263 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
264
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
265 # if @GNULIB_GETSOCKNAME@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
266 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
267 # undef getsockname
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
268 # define getsockname rpl_getsockname
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
269 extern int rpl_getsockname (int, struct sockaddr *, int *)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
270 _GL_ARG_NONNULL ((2, 3));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
271 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
272 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
273 # undef getsockname
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
274 # define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
275 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
276 # undef getsockname
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
277 # if HAVE_RAW_DECL_GETSOCKNAME
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
278 _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
279 "use gnulib module getsockname for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
280 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
281 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
282
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
283 # if @GNULIB_GETSOCKOPT@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
284 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
285 # undef getsockopt
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
286 # define getsockopt rpl_getsockopt
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
287 extern int rpl_getsockopt (int, int, int, void *, socklen_t *)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
288 _GL_ARG_NONNULL ((4, 5));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
289 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
290 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
291 # undef getsockopt
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
292 # define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
293 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
294 # undef getsockopt
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
295 # if HAVE_RAW_DECL_GETSOCKOPT
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
296 _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
297 "use gnulib module getsockopt for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
298 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
299 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
300
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
301 # if @GNULIB_LISTEN@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
302 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
303 # undef listen
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
304 # define listen rpl_listen
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
305 extern int rpl_listen (int, int);
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
306 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
307 # elif @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
308 # undef listen
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
309 # define listen listen_used_without_requesting_gnulib_module_listen
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
310 # elif defined GNULIB_POSIXCHECK
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
311 # undef listen
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
312 # if HAVE_RAW_DECL_LISTEN
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
313 _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
314 "use gnulib module listen for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
315 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
316 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
317
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
318 # if @GNULIB_RECV@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
319 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
320 # undef recv
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
321 # define recv rpl_recv
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
322 extern int rpl_recv (int, void *, int, int) _GL_ARG_NONNULL ((2));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
323 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
324 # elif @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
325 # undef recv
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
326 # define recv recv_used_without_requesting_gnulib_module_recv
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
327 # elif defined GNULIB_POSIXCHECK
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
328 # undef recv
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
329 # if HAVE_RAW_DECL_RECV
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
330 _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
331 "use gnulib module recv for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
332 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
333 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
334
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
335 # if @GNULIB_SEND@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
336 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
337 # undef send
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
338 # define send rpl_send
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
339 extern int rpl_send (int, const void *, int, int) _GL_ARG_NONNULL ((2));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
340 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
341 # elif @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
342 # undef send
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
343 # define send send_used_without_requesting_gnulib_module_send
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
344 # elif defined GNULIB_POSIXCHECK
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
345 # undef send
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
346 # if HAVE_RAW_DECL_SEND
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
347 _GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
348 "use gnulib module send for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
349 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
350 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
351
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
352 # if @GNULIB_RECVFROM@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
353 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
354 # undef recvfrom
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
355 # define recvfrom rpl_recvfrom
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
356 extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
357 _GL_ARG_NONNULL ((2));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
358 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
359 # elif @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
360 # undef recvfrom
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
361 # define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
362 # elif defined GNULIB_POSIXCHECK
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
363 # undef recvfrom
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
364 # if HAVE_RAW_DECL_RECVFROM
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
365 _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
366 "use gnulib module recvfrom for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
367 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
368 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
369
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
370 # if @GNULIB_SENDTO@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
371 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
372 # undef sendto
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
373 # define sendto rpl_sendto
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
374 extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
375 _GL_ARG_NONNULL ((2));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
376 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
377 # elif @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
378 # undef sendto
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
379 # define sendto sendto_used_without_requesting_gnulib_module_sendto
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
380 # elif defined GNULIB_POSIXCHECK
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
381 # undef sendto
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
382 # if HAVE_RAW_DECL_SENDTO
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
383 _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
384 "use gnulib module sendto for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
385 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
386 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
387
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
388 # if @GNULIB_SETSOCKOPT@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
389 # if @HAVE_WINSOCK2_H@
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
390 # undef setsockopt
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
391 # define setsockopt rpl_setsockopt
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
392 extern int rpl_setsockopt (int, int, int, const void *, socklen_t)
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 12421
diff changeset
393 _GL_ARG_NONNULL ((4));
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
394 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
395 # elif @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
396 # undef setsockopt
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
397 # define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
398 # elif defined GNULIB_POSIXCHECK
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
399 # undef setsockopt
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
400 # if HAVE_RAW_DECL_SETSOCKOPT
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
401 _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
402 "use gnulib module setsockopt for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
403 # endif
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
404 # endif
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
405
10624
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
406 # if @GNULIB_SHUTDOWN@
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
407 # if @HAVE_WINSOCK2_H@
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
408 # undef shutdown
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
409 # define shutdown rpl_shutdown
10624
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
410 extern int rpl_shutdown (int, int);
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
411 # endif
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
412 # elif @HAVE_WINSOCK2_H@
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
413 # undef shutdown
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
414 # define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
415 # elif defined GNULIB_POSIXCHECK
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
416 # undef shutdown
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
417 # if HAVE_RAW_DECL_SHUTDOWN
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
418 _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
419 "use gnulib module shutdown for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
420 # endif
10624
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
421 # endif
175cb8a02a3e New module 'shutdown'.
Bruno Haible <bruno@clisp.org>
parents: 10616
diff changeset
422
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
423 # if @HAVE_WINSOCK2_H@
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
424 # undef select
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
425 # define select select_used_without_including_sys_select_h
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
426 # endif
10466
1783808b8d00 add sockets wrappers
Paolo Bonzini <bonzini@gnu.org>
parents: 10430
diff changeset
427
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
428 # ifdef __cplusplus
10539
affb655993ea Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 10474
diff changeset
429 }
10594
43282f926709 New modules 'accept', 'bind', 'connect', 'getpeername', 'getsockname', 'getsockopt', 'listen', 'recv', 'recvfrom', 'send', 'sendto', 'setsockopt', 'socket'.
Bruno Haible <bruno@clisp.org>
parents: 10562
diff changeset
430 # endif
9962
7263aa22b4d6 Cast fourth argument to setsockopt on MinGW.
Simon Josefsson <simon@josefsson.org>
parents: 9907
diff changeset
431
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
432 #endif /* HAVE_SYS_SOCKET_H */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
433
11898
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
434 #ifdef __cplusplus
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
435 extern "C" {
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
436 #endif
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
437
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
438 #if @GNULIB_ACCEPT4@
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
439 /* Accept a connection on a socket, with specific opening flags.
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
440 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
441 and O_TEXT, O_BINARY (defined in "binary-io.h").
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
442 See also the Linux man page at
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
443 <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
11899
f0c8cf1802a2 Tolerate declared but missing accept4 syscall.
Bruno Haible <bruno@clisp.org>
parents: 11898
diff changeset
444 # if @HAVE_ACCEPT4@
f0c8cf1802a2 Tolerate declared but missing accept4 syscall.
Bruno Haible <bruno@clisp.org>
parents: 11898
diff changeset
445 # define accept4 rpl_accept4
f0c8cf1802a2 Tolerate declared but missing accept4 syscall.
Bruno Haible <bruno@clisp.org>
parents: 11898
diff changeset
446 # endif
11898
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
447 extern int accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11899
diff changeset
448 int flags);
11898
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
449 #elif defined GNULIB_POSIXCHECK
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
450 # undef accept4
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
451 # if HAVE_RAW_DECL_ACCEPT4
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
452 _GL_WARN_ON_USE (accept4, "accept4 is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
453 "use gnulib module accept4 for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
454 # endif
11898
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
455 #endif
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
456
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
457 #ifdef __cplusplus
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
458 }
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
459 #endif
90fb3f330caf New module 'accept4'.
Bruno Haible <bruno@clisp.org>
parents: 11577
diff changeset
460
9266
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
461 #endif /* _GL_SYS_SOCKET_H */
2e4b4a414ab5 Rename sys_socket_.h to sys_socket.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
462 #endif /* _GL_SYS_SOCKET_H */