3 #include <sys/socket.h>
6 #include <netinet/in.h>
10 struct hostent *gethostbyname2(const char *name, int af)
12 static struct hostent *h;
18 h = malloc(size+=size+1);
20 h_errno = NO_RECOVERY;
23 err = gethostbyname2_r(name, af, h,
24 (void *)(h+1), size-sizeof *h, &res, &h_errno);
25 } while (err == ERANGE);