5 #include <netinet/in.h>
9 struct hostent
*gethostbyaddr(const void *a
, socklen_t l
, int af
)
11 static struct hostent
*h
;
17 h
= malloc(size
+=size
+1);
19 h_errno
= NO_RECOVERY
;
22 err
= gethostbyaddr_r(a
, l
, af
, h
,
23 (void *)(h
+1), size
-sizeof *h
, &res
, &h_errno
);
24 } while (err
== ERANGE
);