On Thu, 19 Jul 2001, Roy T. Fielding wrote:
| The test needs to be a bit more complicated than that,
| since Solaris has different definitions of gethostbyname_r defined based
| on the POSIX level. Bugger, it looks like the Solaris man page is
| recommending against that function anyway, in favor of getipnodebyname()
| because the old ones won't work with IPv6. What's the likelihood
| that it will be portable? Perhaps we should write a test for each
| and use the best one found.
getipnodebyname() is new as of Solaris 8.
In Solaris 8, it is preferable to use the IPv6-derived getaddrinfo() (as
we already do)
In < Solaris 8, we should use gethostby{addr|name}_r() when threads are
used (which is the default.)
On the issue of it being overhead... I think the point's moot since we're
wanting to do a DNS lookup anyways. True, in httpd, that may matter. But
for other apps (samba, perhaps), the benefit of a resolver outwieghs any
overhead it may cause.
So let's finish this out with a rounded-out resolver interface and strike
an item of the httpd STATUS list. I know that the icecast streaming mp3
server deals with the various implementations of gethostby*_r, and
eventhough it's GPL, it may be worth a look at for ideas.
/dale