From: trustee on
Ah ok...the function that I posted is *not* the function that gets
called.

The real gethostbyname is automatically generated by the preprocessor
in the files inet/gethstbynm.c, nss/getXXbyYY.c and nss/getXXbyYY_r.c.
IP parsing is done in nss/digits_dots.c.

I could make it accept IPv6 addresses by changing AF_INET to AF_INET6
in the following code. But after that it won't accept IPv4
addresses. ;-)

nss/getXXbyYY.c

#ifdef HAVE_AF
# define AF_VAL af
#else
# define AF_VAL AF_INET
#endif

Bye.
From: Rick Jones on
You *really* aught to be migrating to getaddrinfo()/getnodeinfo().

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
From: trustee on
> You *really* aught to be migrating to getaddrinfo()/getnodeinfo().

I have written two classes, one with getaddrinfo and one with
gethostbyname.

I implemented the gethostbyname stuff only for fun, i know that it is
not recommended nowadays. :)