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