On Wed, 16 Jan 2002, Hrvoje Niksic wrote:

> Please don't use gethostbyname2.  It's apparently a GNU extension, and I
> don't think it will work anywhere except on Linux.

gethostbyname2() is defined in RFC2133 if I'm not mistaking. getaddrinfo()
was introduced in RFC2553 (which osoletes 2133).

Books like Stevens' "Unix Network Programing" 2nd edition promotes and
teaches the use of gethostbyname2()...

RFC2553 says (I quote):
 "RFC 2133 defined a function named gethostbyname2() but this function was
 also inadequate, first because its use required setting a global option
 (RES_USE_INET6) when IPv6 addresses were required, and second because a flag
 argument is needed to provide the caller with additional control over the
 types of addresses required."

If a simple gethostbyname() replacement is what you want, getipnodebyname()
should be used if getaddrinfo() doesn't do it.

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol


Reply via email to