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