This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] gethostbyname2


On Feb 25 23:03, Pierre A. Humblet wrote:
> I tried to compile Exim with IPv6 enabled and Cygwin 1.7, but it needs 
> gethostbyname2.
> Here is an implementation of that function.
> In attachment I am including the same patch as well as a short test function.
>
> Pierre
>
>
>
> 2009-02-25  Pierre Humblet <Pierre.Humblet@ieee.org>
>
> 	* net.cc: Include windns.h.
> 	(gethostbyname2): New function.
> 	* cygwin.din: Export gethostbyname2.

This is way cool!  I have this function on my TODO list for ages.

But there's a problem.  You're using DnsQuery_A directly, but this
function only exists since Win2K.  Would it be a big problem to rework
the function to use the resolver functions instead?  They are part of
Cygwin now anyway and that would abstract gethostbyname2 from the
underlying OS capabilities.

The implications of having this function... for instance, we can
implement gethostbyname then in terms of gethostbyname2 and honor
the RES_USE_INET6 flag.  We could even drop relying on the Winsock
implementation of getaddrinfo/getnameinfo and use the Stevens
implementation exclusively.  Wow.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]