blob: 9dc4f5dde4ceb74f2773f4fcafdc881fa7bd93c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#include <sys/socket.h>
const char* gai_strerror(int error) {
switch (error) {
case EAI_FAMILY: return "family not supported";
case EAI_SOCKTYPE: return "socket type not supported";
case EAI_NONAME: return "unknown host";
case EAI_SERVICE: return "unknown service";
case EAI_MEMORY: return "memory allocation failure";
case EAI_AGAIN: return "temporary failure";
}
return "DNS error. Sorry.";
}
|