summaryrefslogtreecommitdiffstats
path: root/gl/netdb.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/netdb.in.h')
-rw-r--r--gl/netdb.in.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/gl/netdb.in.h b/gl/netdb.in.h
index 9549cd73..22059ea0 100644
--- a/gl/netdb.in.h
+++ b/gl/netdb.in.h
@@ -1,5 +1,5 @@
1/* Provide a netdb.h header file for systems lacking it (read: MinGW). 1/* Provide a netdb.h header file for systems lacking it (read: MinGW).
2 Copyright (C) 2008-2023 Free Software Foundation, Inc. 2 Copyright (C) 2008-2025 Free Software Foundation, Inc.
3 Written by Simon Josefsson. 3 Written by Simon Josefsson.
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
@@ -36,6 +36,11 @@
36#ifndef _@GUARD_PREFIX@_NETDB_H 36#ifndef _@GUARD_PREFIX@_NETDB_H
37#define _@GUARD_PREFIX@_NETDB_H 37#define _@GUARD_PREFIX@_NETDB_H
38 38
39/* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
40#if !_GL_CONFIG_H_INCLUDED
41 #error "Please include config.h first."
42#endif
43
39/* Get <netdb.h> definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and 44/* Get <netdb.h> definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and
40 'struct hostent' on MinGW. */ 45 'struct hostent' on MinGW. */
41#include <sys/socket.h> 46#include <sys/socket.h>
@@ -49,6 +54,14 @@
49/* Declarations for a platform that lacks <netdb.h>, or where it is 54/* Declarations for a platform that lacks <netdb.h>, or where it is
50 incomplete. */ 55 incomplete. */
51 56
57/* Maximum length of a fully-qualified domain name. */
58#undef NI_MAXHOST
59#define NI_MAXHOST 1025
60
61/* Maximum length of a service. */
62#undef NI_MAXSERV
63#define NI_MAXSERV 32
64
52#if @GNULIB_GETADDRINFO@ 65#if @GNULIB_GETADDRINFO@
53 66
54# if !@HAVE_STRUCT_ADDRINFO@ 67# if !@HAVE_STRUCT_ADDRINFO@
@@ -86,12 +99,11 @@ struct addrinfo
86# ifndef AI_CANONNAME 99# ifndef AI_CANONNAME
87# define AI_CANONNAME 0x0002 /* Request for canonical name. */ 100# define AI_CANONNAME 0x0002 /* Request for canonical name. */
88# endif 101# endif
89# ifndef AI_NUMERICSERV 102# ifndef AI_NUMERICHOST
90# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ 103# define AI_NUMERICHOST 0x0004 /* Return numeric host address as name. */
91# endif 104# endif
92 105# ifndef AI_NUMERICSERV
93# if 0 106# define AI_NUMERICSERV 0x0400 /* Return service number as service name. */
94# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
95# endif 107# endif
96 108
97/* These symbolic constants are required to be present by POSIX, but 109/* These symbolic constants are required to be present by POSIX, but
@@ -171,7 +183,7 @@ _GL_FUNCDECL_RPL (getaddrinfo, int,
171 (const char *restrict nodename, 183 (const char *restrict nodename,
172 const char *restrict servname, 184 const char *restrict servname,
173 const struct addrinfo *restrict hints, 185 const struct addrinfo *restrict hints,
174 struct addrinfo **restrict res) 186 struct addrinfo **restrict res),
175 _GL_ARG_NONNULL ((4))); 187 _GL_ARG_NONNULL ((4)));
176_GL_CXXALIAS_RPL (getaddrinfo, int, 188_GL_CXXALIAS_RPL (getaddrinfo, int,
177 (const char *restrict nodename, 189 (const char *restrict nodename,
@@ -184,7 +196,7 @@ _GL_FUNCDECL_SYS (getaddrinfo, int,
184 (const char *restrict nodename, 196 (const char *restrict nodename,
185 const char *restrict servname, 197 const char *restrict servname,
186 const struct addrinfo *restrict hints, 198 const struct addrinfo *restrict hints,
187 struct addrinfo **restrict res) 199 struct addrinfo **restrict res),
188 _GL_ARG_NONNULL ((4))); 200 _GL_ARG_NONNULL ((4)));
189# endif 201# endif
190_GL_CXXALIAS_SYS (getaddrinfo, int, 202_GL_CXXALIAS_SYS (getaddrinfo, int,
@@ -203,12 +215,12 @@ _GL_CXXALIASWARN (getaddrinfo);
203# undef freeaddrinfo 215# undef freeaddrinfo
204# define freeaddrinfo rpl_freeaddrinfo 216# define freeaddrinfo rpl_freeaddrinfo
205# endif 217# endif
206_GL_FUNCDECL_RPL (freeaddrinfo, void, (struct addrinfo *ai) 218_GL_FUNCDECL_RPL (freeaddrinfo, void, (struct addrinfo *ai),
207 _GL_ARG_NONNULL ((1))); 219 _GL_ARG_NONNULL ((1)));
208_GL_CXXALIAS_RPL (freeaddrinfo, void, (struct addrinfo *ai)); 220_GL_CXXALIAS_RPL (freeaddrinfo, void, (struct addrinfo *ai));
209# else 221# else
210# if !@HAVE_DECL_FREEADDRINFO@ 222# if !@HAVE_DECL_FREEADDRINFO@
211_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai) 223_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai),
212 _GL_ARG_NONNULL ((1))); 224 _GL_ARG_NONNULL ((1)));
213# endif 225# endif
214_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai)); 226_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai));
@@ -220,14 +232,14 @@ _GL_CXXALIASWARN (freeaddrinfo);
220# undef gai_strerror 232# undef gai_strerror
221# define gai_strerror rpl_gai_strerror 233# define gai_strerror rpl_gai_strerror
222# endif 234# endif
223_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode)); 235_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode), );
224_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode)); 236_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode));
225# else 237# else
226# if !@HAVE_DECL_GAI_STRERROR@ 238# if !@HAVE_DECL_GAI_STRERROR@
227/* Convert error return from getaddrinfo() to a string. 239/* Convert error return from getaddrinfo() to a string.
228 For more details, see the POSIX:2008 specification 240 For more details, see the POSIX:2008 specification
229 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gai_strerror.html>. */ 241 <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gai_strerror.html>. */
230_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode)); 242_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode), );
231# endif 243# endif
232_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode)); 244_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode));
233# endif 245# endif
@@ -243,7 +255,7 @@ _GL_FUNCDECL_SYS (getnameinfo, int,
243 (const struct sockaddr *restrict sa, socklen_t salen, 255 (const struct sockaddr *restrict sa, socklen_t salen,
244 char *restrict node, socklen_t nodelen, 256 char *restrict node, socklen_t nodelen,
245 char *restrict service, socklen_t servicelen, 257 char *restrict service, socklen_t servicelen,
246 int flags) 258 int flags),
247 _GL_ARG_NONNULL ((1))); 259 _GL_ARG_NONNULL ((1)));
248# endif 260# endif
249/* Need to cast, because on glibc systems, the seventh parameter is 261/* Need to cast, because on glibc systems, the seventh parameter is