OpenBSD manual page server

Manual Page Search Parameters

GAI_STRERROR(3) Library Functions Manual GAI_STRERROR(3)

gai_strerrorget error message string from EAI_xxx error code

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

const char *
gai_strerror(int ecode);

The () function returns an error message string corresponding to the error code returned by getaddrinfo(3) or getnameinfo(3).

The following error codes and their meaning are defined in <netdb.h>:

address family for name not supported
temporary failure in name resolution
invalid value for ai_flags
invalid value for hints
non-recoverable failure in name resolution
ai_family not supported
memory allocation failure
no address associated with name
name or service not provided, or not known
argument buffer overflow
resolved protocol is unknown
service not supported for ai_socktype
ai_socktype not supported
system error (returned in errno)

gai_strerror() returns a pointer to the error message string corresponding to ecode. If ecode is out of range, an implementation-specific error message string is returned.

getaddrinfo(3), getnameinfo(3)

May 3, 2017 OpenBSD-6.2