minires-0.95 - a new package ready for review

Pierre A. Humblet Pierre.Humblet@ieee.org
Thu Jun 12 17:18:00 GMT 2003


Corinna Vinschen wrote:
> 
> On Thu, Jun 12, 2003 at 11:49:28AM -0400, Pierre A. Humblet wrote:
> > Christopher Faylor wrote:
> > >
> > > On Wed, Jun 11, 2003 at 10:33:36PM -0400, Nicholas Wourms wrote:
> > > >Now as to whether it should be spun as a separate dll/import library
> > > >(-lresolv), is another matter, entirely.  Of course, feel free to
> > > >disagree, as I could be wrong ;-).
> > >
> > > I think it belongs in newlib, too.  Anyone willing to take a shot at
> > > getting it into newlib?
> >
> > Is newlib the right place? minires uses the Windows API to find the dns
> > servers and the domain name. Is there a POSIX way to get those?
> > If so, it could be implemented in Cygwin.
> > In the long run the lookups should use the Windows resolver (on
> > systems >= Win2000). BTW, that's why it's 0.95 and not 1.00
> 
> Hmm, AFAICS the code is using standard socket calls, not especially
> Windows socket calls.  The only problem is the get_dns() function
> which gets the DNS servers by calling a Windows API function.  OTOH,
> this function's result is overridden if a resolve.conf file exists.

Correct.

> An appropriate #ifdef would do it.

What #ifdef? __CYGWIN__ ?
I had not realized newlib ever allowed calling the Windows API. 

> OTOH, there's one problem.  The code is linked against iphlpapi.lib.
> This lib doesn't exist on 95 and NT4.  Wouldn't it be better to get
> the function address at runtime (LoadLibrary/GetProcAddress) and if
> that fails, just to return to look for resolve.conf?

It works on my antique Win95 and on my CYGWIN_NT-4.0. There the Windows
functions return an error and minires falls back to resolv.conf
Of course LoadLibrary/GetProcAddres would work too.
I have recently noticed that the information is in fact available
from the registry, but getting to it is not straightforward
(same kind of indirect lookups as in net.cc), so with some effort...

Pierre



More information about the Cygwin-apps mailing list