xref: /freebsd/lib/libc/net/gai_strerror.3 (revision ebccf1e3a6b11b97cbf5f813dd76636e892a9035)
1.\"	$KAME: gai_strerror.3,v 1.1 2005/01/05 03:04:47 itojun Exp $
2.\"	$OpenBSD: gai_strerror.3,v 1.4 2004/12/20 23:04:53 millert Exp $
3.\"	$FreeBSD$
4.\"
5.\" Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
6.\" Copyright (C) 2000, 2001  Internet Software Consortium.
7.\"
8.\" Permission to use, copy, modify, and distribute this software for any
9.\" purpose with or without fee is hereby granted, provided that the above
10.\" copyright notice and this permission notice appear in all copies.
11.\"
12.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13.\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14.\" AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16.\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18.\" PERFORMANCE OF THIS SOFTWARE.
19.\"
20.Dd December 20, 2004
21.Dt GAI_STRERROR 3
22.Os
23.Sh NAME
24.Nm gai_strerror
25.Nd get error message string from EAI_xxx error code
26.Sh SYNOPSIS
27.Fd #include <sys/types.h>
28.Fd #include <sys/socket.h>
29.Fd #include <netdb.h>
30.Ft "const char *"
31.Fn gai_strerror "int ecode"
32.Sh DESCRIPTION
33The
34.Fn gai_strerror
35function returns an error message string corresponding to the error code
36returned by
37.Xr getaddrinfo 3
38or
39.Xr getnameinfo 3 .
40.Pp
41The following error codes and their meaning are defined in
42.Aq Pa netdb.h :
43.Pp
44.Bl -tag -width "EAI_ADDRFAMILYXX" -offset indent -compact
45.It Dv EAI_AGAIN
46temporary failure in name resolution
47.It Dv EAI_BADFLAGS
48invalid value for
49.Fa ai_flags
50.It Dv EAI_BADHINTS
51invalid value for
52.Fa hints
53.It Dv EAI_FAIL
54non-recoverable failure in name resolution
55.It Dv EAI_FAMILY
56.Fa ai_family
57not supported.
58.It Dv EAI_MEMORY
59memory allocation failure
60.It Dv EAI_NONAME
61.Fa hostname
62or
63.Fa servname
64not provided, or not known
65.It Dv EAI_PROTOCOL
66resolved protocol is unknown
67.It Dv EAI_SERVICE
68.Fa servname
69not supported for
70.Fa ai_socktype
71.It Dv EAI_SOCKTYPE
72.Fa ai_socktype
73not supported
74.It Dv EAI_SYSTEM
75system error returned in
76.Va errno
77.El
78.Sh RETURN VALUES
79.Fn gai_strerror
80returns a pointer to the error message string corresponding to
81.Fa ecode .
82If
83.Fa ecode
84is out of range, an implementation-specific error message string is returned.
85.Sh SEE ALSO
86.Xr getaddrinfo 3 ,
87.Xr getnameinfo 3
88