initial check-in, version 0.5.0
[musl] / src / network / gai_strerror.c
1 #include <netdb.h>
2
3 static const char msgs[] =
4         "Invalid flags\0"
5         "Name does not resolve\0"
6         "Try again\0"
7         "Non-recoverable error\0"
8         "Unrecognized address family or invalid length\0"
9         "Unrecognized socket type\0"
10         "Unrecognized service\0"
11         "Out of memory\0"
12         "System error\0"
13         "Overflow\0"
14         "\0Unknown error";
15
16 const char *gai_strerror(int ecode)
17 {
18         const char *s;
19         for (s=msgs, ecode++; ecode && *s; ecode++, s++) for (; *s; s++);
20         return *s ? s : s+1;
21 }