]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/net/gai_strerror.3
libpcap: Update to 1.10.4
[FreeBSD/FreeBSD.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$
20 .\"
21 .Dd November 2, 2022
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
34 The
35 .Fn gai_strerror
36 function returns an error message string corresponding to the error code
37 returned by
38 .Xr getaddrinfo 3
39 or
40 .Xr getnameinfo 3 .
41 .Pp
42 The following error codes and their meaning are defined in
43 .In netdb.h :
44 .Pp
45 .Bl -tag -width ".Dv EAI_ADDRFAMILY" -offset indent -compact
46 .It Dv EAI_ADDRFAMILY
47 Address family for hostname not supported
48 .It Dv EAI_AGAIN
49 Name could not be resolved at this time
50 .It Dv EAI_BADFLAGS
51 flags parameter had an invalid value
52 .It Dv EAI_BADHINTS
53 invalid value for
54 .Fa hints
55 .It Dv EAI_FAIL
56 Non-recoverable failure in name resolution
57 .It Dv EAI_FAMILY
58 Address family was not recognized
59 .It Dv EAI_MEMORY
60 Memory allocation failure
61 .It Dv EAI_NODATA
62 No address associated with hostname
63 .It Dv EAI_NONAME
64 Name does not resolve
65 .It Dv EAI_OVERFLOW
66 argument buffer overflow
67 .It Dv EAI_PROTOCOL
68 Resolved protocol is unknown
69 .It Dv EAI_SERVICE
70 Service was not recognized for socket type
71 .It Dv EAI_SOCKTYPE
72 Intended socket type was not recognized
73 .It Dv EAI_SYSTEM
74 System error returned in
75 .Va errno
76 .El
77 .Sh RETURN VALUES
78 The
79 .Fn gai_strerror
80 function
81 returns a pointer to the error message string corresponding to
82 .Fa ecode .
83 If
84 .Fa ecode
85 is out of range, an implementation-specific error message string is returned.
86 .Sh SEE ALSO
87 .Xr getaddrinfo 3 ,
88 .Xr getnameinfo 3
89 .Sh STANDARDS
90 .Bl -tag -width ".It RFC 3493"
91 .It RFC 3493
92 Basic Socket Interface Extensions for IPv6
93 .El
94 .Pp
95 EAI_ADDRFAMILY and EAI_NODATA were in previous RFCs, but not in RFC 3493.
96 They are not in POSIX (IEEE Std 1003.1-2017).
97 They were in
98 .Fx
99 before 5.2, and were re-added for 14.0.
100 EAI_BADHINTS, EAI_OVERFLOW, and EAI_PROTOCOL are not in RFC 3493 or POSIX.