#include <sys/socket.h>
#include <netdb.h>
-#include <string.h>
-#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
err = gethostbyname2_r(name, af, h,
(void *)(h+1), size-sizeof *h, &res, &h_errno);
} while (err == ERANGE);
- return err ? 0 : h;
+ return res;
}