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