Merge branch 'vendor/FILE'
[dragonfly.git] / lib / libc / net / gai_strerror.3
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: src/lib/libc/net/gai_strerror.3,v 1.5 2006/09/17 21:27:33 ru Exp $
20 .\" $DragonFly: src/lib/libc/net/gai_strerror.3,v 1.2 2008/10/07 06:57:40 swildner Exp $
21 .\"
22 .Dd October 4, 2008
23 .Dt GAI_STRERROR 3
24 .Os
25 .Sh NAME
26 .Nm gai_strerror
27 .Nd get error message string from EAI_xxx error code
28 .Sh LIBRARY
29 .Lb libc
30 .Sh SYNOPSIS
31 .In sys/types.h
32 .In sys/socket.h
33 .In netdb.h
34 .Ft "const char *"
35 .Fn gai_strerror "int ecode"
36 .Sh DESCRIPTION
37 The
38 .Fn gai_strerror
39 function returns an error message string corresponding to the error code
40 returned by
41 .Xr getaddrinfo 3
42 or
43 .Xr getnameinfo 3 .
44 .Pp
45 The following error codes and their meaning are defined in
46 .In netdb.h :
47 .Pp
48 .Bl -tag -width ".Dv EAI_ADDRFAMILY" -offset indent -compact
49 .It Dv EAI_ADDRFAMILY
50 address family for
51 .Fa hostname
52 not supported
53 .It Dv EAI_AGAIN
54 temporary failure in name resolution
55 .It Dv EAI_BADFLAGS
56 invalid value for
57 .Fa ai_flags
58 .It Dv EAI_BADHINTS
59 invalid value for
60 .Fa hints
61 .It Dv EAI_FAIL
62 non-recoverable failure in name resolution
63 .It Dv EAI_FAMILY
64 .Fa ai_family
65 not supported
66 .It Dv EAI_MEMORY
67 memory allocation failure
68 .It Dv EAI_NODATA
69 no address associated with
70 .Fa hostname
71 .It Dv EAI_NONAME
72 .Fa hostname
73 or
74 .Fa servname
75 not provided, or not known
76 .It Dv EAI_OVERFLOW
77 argument buffer overflow
78 .It Dv EAI_PROTOCOL
79 resolved protocol is unknown
80 .It Dv EAI_SERVICE
81 .Fa servname
82 not supported for
83 .Fa ai_socktype
84 .It Dv EAI_SOCKTYPE
85 .Fa ai_socktype
86 not supported
87 .It Dv EAI_SYSTEM
88 system error returned in
89 .Va errno
90 .El
91 .Sh RETURN VALUES
92 The
93 .Fn gai_strerror
94 function
95 returns a pointer to the error message string corresponding to
96 .Fa ecode .
97 If
98 .Fa ecode
99 is out of range, an implementation-specific error message string is returned.
100 .Sh SEE ALSO
101 .Xr getaddrinfo 3 ,
102 .Xr getnameinfo 3