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