struct hostent *gethostbyname2(const char *name, int family)
{
	static struct hostent hoste;
	static char *buf = NULL;
	struct hostent *hp;

	__INIT_GETXX_BUF(GETXX_BUFSZ);
#ifndef __UCLIBC_HAS_IPV6__
	if (family != AF_INET)
		return (struct hostent*)NULL;
	gethostbyname_r(name, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
#else
	gethostbyname2_r(name, family, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
#endif /* __UCLIBC_HAS_IPV6__ */

	return hp;
}
struct hostent *gethostbyname2(const char *name, int family)
{
	static struct hostent hoste;
	static char *buf = NULL;
	struct hostent *hp;

	__INIT_GETXX_BUF(GETXX_BUFSZ);
#ifndef __UCLIBC_HAS_IPV6__
	if (family != AF_INET)
		return (struct hostent*)NULL;
	gethostbyname_r(name, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
#else
	gethostbyname2_r(name, family, &hoste, buf, GETXX_BUFSZ, &hp, &h_errno);
#endif  

	return hp;
}