148
164
socket addresses.
149
165
For more details, see the POSIX:2001 specification
150
166
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
151
extern int getaddrinfo (const char *restrict nodename,
152
const char *restrict servname,
153
const struct addrinfo *restrict hints,
154
struct addrinfo **restrict res)
155
_GL_ARG_NONNULL ((4));
167
_GL_FUNCDECL_SYS (getaddrinfo, int,
168
(const char *restrict nodename,
169
const char *restrict servname,
170
const struct addrinfo *restrict hints,
171
struct addrinfo **restrict res)
172
_GL_ARG_NONNULL ((4)));
174
_GL_CXXALIAS_SYS (getaddrinfo, int,
175
(const char *restrict nodename,
176
const char *restrict servname,
177
const struct addrinfo *restrict hints,
178
struct addrinfo **restrict res));
179
_GL_CXXALIASWARN (getaddrinfo);
158
181
# if !@HAVE_DECL_FREEADDRINFO@
159
182
/* Free `addrinfo' structure AI including associated storage.
160
183
For more details, see the POSIX:2001 specification
161
184
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
162
extern void freeaddrinfo (struct addrinfo *ai) _GL_ARG_NONNULL ((1));
185
_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai)
186
_GL_ARG_NONNULL ((1)));
188
_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai));
189
_GL_CXXALIASWARN (freeaddrinfo);
165
# if !@HAVE_DECL_GAI_STRERROR@
191
# if @REPLACE_GAI_STRERROR@
192
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
194
# define gai_strerror rpl_gai_strerror
196
_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode));
197
_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode));
199
# if !@HAVE_DECL_GAI_STRERROR@
166
200
/* Convert error return from getaddrinfo() to a string.
167
201
For more details, see the POSIX:2001 specification
168
202
<http://www.opengroup.org/susv3xsh/gai_strerror.html>. */
169
extern const char *gai_strerror (int ecode);
203
_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode));
205
_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode));
207
_GL_CXXALIASWARN (gai_strerror);
172
209
# if !@HAVE_DECL_GETNAMEINFO@
173
210
/* Convert socket address to printable node and service names.
174
211
For more details, see the POSIX:2001 specification
175
212
<http://www.opengroup.org/susv3xsh/getnameinfo.html>. */
176
extern int getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
213
_GL_FUNCDECL_SYS (getnameinfo, int,
214
(const struct sockaddr *restrict sa, socklen_t salen,
215
char *restrict node, socklen_t nodelen,
216
char *restrict service, socklen_t servicelen,
218
_GL_ARG_NONNULL ((1)));
220
/* Need to cast, because on glibc systems, the seventh parameter is
221
unsigned int flags. */
222
_GL_CXXALIAS_SYS_CAST (getnameinfo, int,
223
(const struct sockaddr *restrict sa, socklen_t salen,
177
224
char *restrict node, socklen_t nodelen,
178
225
char *restrict service, socklen_t servicelen,
180
_GL_ARG_NONNULL ((1));
227
_GL_CXXALIASWARN (getnameinfo);
183
229
/* Possible flags for getnameinfo. */
184
230
# ifndef NI_NUMERICHOST