7 #include <sys/socket.h>
8 #include <netinet/in.h>
14 static char *tab[] = {
16 /* EAI_BADFLAGS */ "Invalid value for `ai_flags' field",
17 /* EAI_NONAME */ "NAME or SERVICE is unknown",
18 /* EAI_AGAIN */ "Temporary failure in name resolution",
19 /* EAI_FAIL */ "Non-recoverable failure in name resolution",
20 /* EAI_NODATA */ "No address associated with NAME",
21 /* EAI_FAMILY */ "`ai_family' not supported",
22 /* EAI_SOCKTYPE */ "`ai_socktype' not supported",
23 /* EAI_SERVICE */ "SERVICE not supported for `ai_socktype'",
24 /* EAI_ADDRFAMILY */ "Address family for NAME not supported",
25 /* EAI_MEMORY */ "Memory allocation failure",
26 /* EAI_SYSTEM */ "System error returned in `errno'",
27 /* EAI_OVERFLOW */ "Argument buffer overflow",
31 if(err < 0 || err >= (sizeof(tab)/sizeof(tab[0])))
32 return "Unknown error";