Libinfo-278.0.3.tar.gz
[apple/libinfo.git] / lookup.subproj / 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.3 2005/06/16 19:01:06 ru Exp $
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 .Fo gai_strerror
33 .Fa "int ecode"
34 .Fc
35 .Sh DESCRIPTION
36 The
37 .Fn gai_strerror
38 function returns an error message string corresponding to the error code
39 returned by
40 .Xr getaddrinfo 3
41 or
42 .Xr getnameinfo 3 .
43 .Pp
44 The following error codes and their meaning are defined in
45 .In netdb.h :
46 .Pp
47 .Bl -tag -width ".Dv EAI_BADFLAGS" -offset indent -compact
48 .It Dv EAI_AGAIN
49 temporary failure in name resolution
50 .It Dv EAI_BADFLAGS
51 invalid value for
52 .Fa ai_flags
53 .It Dv EAI_BADHINTS
54 invalid value for
55 .Fa hints
56 .It Dv EAI_FAIL
57 non-recoverable failure in name resolution
58 .It Dv EAI_FAMILY
59 .Fa ai_family
60 not supported
61 .It Dv EAI_MEMORY
62 memory allocation failure
63 .It Dv EAI_NONAME
64 .Fa hostname
65 or
66 .Fa servname
67 not provided, or not known
68 .It Dv EAI_PROTOCOL
69 resolved protocol is unknown
70 .It Dv EAI_SERVICE
71 .Fa servname
72 not supported for
73 .Fa ai_socktype
74 .It Dv EAI_SOCKTYPE
75 .Fa ai_socktype
76 not supported
77 .It Dv EAI_SYSTEM
78 system error returned in
79 .Va errno
80 .El
81 .Sh RETURN VALUES
82 The
83 .Fn gai_strerror
84 function
85 returns a pointer to the error message string corresponding to
86 .Fa ecode .
87 If
88 .Fa ecode
89 is out of range, an implementation-specific error message string is returned.
90 .Sh LEGACY SYNOPSIS
91 .Fd #include <sys/types.h>
92 .Fd #include <sys/socket.h>
93 .Fd #include <netdb.h>
94 .Pp
95 The include files
96 .In sys/types.h
97 and
98 .In sys/socket.h
99 are necessary.
100 .Sh SEE ALSO
101 .Xr getaddrinfo 3 ,
102 .Xr getnameinfo 3