51e1c5699856be573a3e45e288af2689772e07be
[musl] / src / network / gethostbyaddr.c
1 #define _GNU_SOURCE
2
3 #include <netdb.h>
4 #include <string.h>
5 #include <netinet/in.h>
6
7 struct hostent *gethostbyaddr(const void *a, socklen_t l, int af)
8 {
9         static struct hostent h;
10         static long buf[512/sizeof(long)];
11         struct hostent *res;
12         if (gethostbyaddr_r(a, l, af, &h,
13                 (void *)buf, sizeof buf, &res, &h_errno)) return 0;
14         return &h;
15 }