gai_strerror TCP UDP

Converts the numerical value of EAI-type error codes returned by getaddrinfo() into a meaningful string.

Files

net_bsd.h/net_bsd.c

Prototype

const char *gai_strerror (int errcode);

Arguments

errcode

The numerical (integer) value of the error code returned by getaddrinfo().

  • EAI_ADDRFAMILY

  • EAI_AGAIN

  • EAI_BADFLAGS

  • EAI_FAIL

  • EAI_FAMILY

  • EAI_MEMORY

  • EAI_NONAME

  • EAI_OVERFLOW

  • EAI_SERVICE

  • EAI_SOCKTYPE

  • EAI_SYSTEM

Returned Value

Pointer to a string that will contain the description of the EAI error so long as it is one of the EAI codes listed in the arguments section above. Otherwise, the string "Unknown EAI error." is returned.