POSIX conformance:
[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.1 2008/10/04 22:09:17 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 SYNOPSIS
29 .In sys/types.h
30 .In sys/socket.h
31 .In netdb.h
32 .Ft "const char *"
33 .Fn gai_strerror "int ecode"
34 .Sh DESCRIPTION
35 The
36 .Fn gai_strerror
37 function returns an error message string corresponding to the error code
38 returned by
39 .Xr getaddrinfo 3
40 or
41 .Xr getnameinfo 3 .
42 .Pp
43 The following error codes and their meaning are defined in
44 .In netdb.h :
45 .Pp
46 .Bl -tag -width ".Dv EAI_ADDRFAMILY" -offset indent -compact
47 .It Dv EAI_ADDRFAMILY
48 address family for
49 .Fa hostname
50 not supported
51 .It Dv EAI_AGAIN
52 temporary failure in name resolution
53 .It Dv EAI_BADFLAGS
54 invalid value for
55 .Fa ai_flags
56 .It Dv EAI_BADHINTS
57 invalid value for
58 .Fa hints
59 .It Dv EAI_FAIL
60 non-recoverable failure in name resolution
61 .It Dv EAI_FAMILY
62 .Fa ai_family
63 not supported
64 .It Dv EAI_MEMORY
65 memory allocation failure
66 .It Dv EAI_NODATA
67 no address associated with
68 .Fa hostname
69 .It Dv EAI_NONAME
70 .Fa hostname
71 or
72 .Fa servname
73 not provided, or not known
74 .It Dv EAI_OVERFLOW
75 argument buffer overflow
76 .It Dv EAI_PROTOCOL
77 resolved protocol is unknown
78 .It Dv EAI_SERVICE
79 .Fa servname
80 not supported for
81 .Fa ai_socktype
82 .It Dv EAI_SOCKTYPE
83 .Fa ai_socktype
84 not supported
85 .It Dv EAI_SYSTEM
86 system error returned in
87 .Va errno
88 .El
89 .Sh RETURN VALUES
90 The
91 .Fn gai_strerror
92 function
93 returns a pointer to the error message string corresponding to
94 .Fa ecode .
95 If
96 .Fa ecode
97 is out of range, an implementation-specific error message string is returned.
98 .Sh SEE ALSO
99 .Xr getaddrinfo 3 ,
100 .Xr getnameinfo 3