---
name: "lwres_gai_strerror"
section: "3"
platform: "macos"
package: "bind9"
version: "65"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/lwres_gai_strerror"
---

# lwres\_gai\_strerror(3)

print suitable error string

## NAME

lwres\_gai\_strerror - print suitable error string

## SYNOPSIS

```
#include <lwres/netdb.h>
```

**char \* gai\_strerror(int** *ecode***);**

## DESCRIPTION

**lwres\_gai\_strerror()** returns an error message corresponding to an error code returned by **getaddrinfo()**. The following error codes and their meaning are defined in include/lwres/netdb.h.

**EAI\_ADDRFAMILY**

address family for hostname not supported

**EAI\_AGAIN**

temporary failure in name resolution

**EAI\_BADFLAGS**

invalid value for **ai\_flags**

**EAI\_FAIL**

non-recoverable failure in name resolution

**EAI\_FAMILY**

**ai\_family** not supported

**EAI\_MEMORY**

memory allocation failure

**EAI\_NODATA**

no address associated with hostname

**EAI\_NONAME**

hostname or servname not provided, or not known

**EAI\_SERVICE**

servname not supported for **ai\_socktype**

**EAI\_SOCKTYPE**

**ai\_socktype** not supported

**EAI\_SYSTEM**

system error returned in errno

The message invalid error code is returned if *ecode* is out of range.

**ai\_flags**, **ai\_family** and **ai\_socktype** are elements of the **struct addrinfo** used by **lwres\_getaddrinfo()**.

## SEE ALSO

[**strerror**(3)](/strerror/3.md), [**lwres\_getaddrinfo**(3)](/lwres_getaddrinfo/3.md), [**getaddrinfo**(3)](/getaddrinfo/3.md), **RFC2133**().

## AUTHOR

**Internet Systems Consortium, Inc.**

## COPYRIGHT

Copyright © 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")\
 Copyright © 2000, 2001 Internet Software Consortium.\
