1.\" $OpenBSD: gai_strerror.3,v 1.10 2017/05/03 01:58:33 deraadt Exp $ 2.\" $KAME: gai_strerror.3,v 1.1 2005/01/05 03:04:47 itojun 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.Dd $Mdocdate: May 3 2017 $ 20.Dt GAI_STRERROR 3 21.Os 22.Sh NAME 23.Nm gai_strerror 24.Nd get error message string from EAI_xxx error code 25.Sh SYNOPSIS 26.In sys/types.h 27.In sys/socket.h 28.In netdb.h 29.Ft "const char *" 30.Fn gai_strerror "int ecode" 31.Sh DESCRIPTION 32The 33.Fn gai_strerror 34function returns an error message string corresponding to the error code 35returned by 36.Xr getaddrinfo 3 37or 38.Xr getnameinfo 3 . 39.Pp 40The following error codes and their meaning are defined in 41.In netdb.h : 42.Pp 43.Bl -tag -width "EAI_ADDRFAMILYXX" -offset indent -compact 44.It Dv EAI_ADDRFAMILY 45address family for 46.Fa name 47not supported 48.It Dv EAI_AGAIN 49temporary failure in name resolution 50.It Dv EAI_BADFLAGS 51invalid value for 52.Fa ai_flags 53.It Dv EAI_BADHINTS 54invalid value for 55.Fa hints 56.It Dv EAI_FAIL 57non-recoverable failure in name resolution 58.It Dv EAI_FAMILY 59.Fa ai_family 60not supported 61.It Dv EAI_MEMORY 62memory allocation failure 63.It Dv EAI_NODATA 64no address associated with 65.Fa name 66.It Dv EAI_NONAME 67.Fa name 68or 69.Fa service 70not provided, or not known 71.It Dv EAI_OVERFLOW 72argument buffer overflow 73.It Dv EAI_PROTOCOL 74resolved protocol is unknown 75.It Dv EAI_SERVICE 76.Fa service 77not supported for 78.Fa ai_socktype 79.It Dv EAI_SOCKTYPE 80.Fa ai_socktype 81not supported 82.It Dv EAI_SYSTEM 83system error (returned in 84.Va errno ) 85.El 86.Sh RETURN VALUES 87.Fn gai_strerror 88returns a pointer to the error message string corresponding to 89.Fa ecode . 90If 91.Fa ecode 92is out of range, an implementation-specific error message string is returned. 93.Sh SEE ALSO 94.Xr getaddrinfo 3 , 95.Xr getnameinfo 3 96