3 #include <sys/socket.h>
6 #include <netinet/in.h>
8 struct hostent *gethostbyname2(const char *name, int af)
10 static struct hostent h;
11 static long buf[512/sizeof(long)];
13 if (gethostbyname2_r(name, af, &h,
14 (void *)buf, sizeof buf, &res, &h_errno)) return 0;