Re: WIN32 PSAPI patch

From: Robert Collins <robert.collins@dont-contact.us>
Date: 21 Oct 2001 20:58:58 +1000

On Sun, 2001-10-21 at 19:40, Guido Serassio wrote:
> Hi Robert,
>
> Il 10.46 21/10/2001 Robert Collins ha scritto:
>
> >Sorry, I was not clear. I meant that perhaps the code should be
> >+#if defined (_SQUID_MSWIN_) || defined (_SQUID_MSWIN_)
>
> Opss, ...
> I think no. On native port the problem is very evident: rotate doesn't
> works ...
> On Cygwin rotate works fine, so I think that this code section is not needed.

Cool. Thanks. I haven't checked that functionality in a while, which is
why I asked.
 
> OK, now I'm using Process Explorer from Sysinternals, and I can see all the
> dynamically dll's loaded from cygwin1.dll, but there isn't psapi.dll ....
> I have looked in Cygwin sources, and I have found the OS dependent dynamic
> load of psapi.dll.
>
> Very strange ...

It's quite a nice hack, and _very_ useful. It avoids explicit
OpenLibrary and getsymbol calls in the code. You link against a dummy
symbol that checks for the dll via OpenLibrary, resolves the symbol, and
rewrites it's entry point to be a long jmp into the now loaded library.
 
>
> > > >Lastly, your xrename alteration to remove(to) is IIRC to handle win32
> > > >rename semantics? A comment in the code there would be useful if that
> >is
> > > >indeed the case.
> > >
> > > OK, I add a more complete comment, and if this code is ok for you, I
> >will
> > > post a new patch.
> >
> >Yes, please do. I do think that a wrapper getrusage lib function is the
> >Right Way to do this.
> >
> >Rob
>
> The only problems is how to handle the info lacks on Cygwin.

Don't. I'll add the appropriate code to cygwin so that it is present in
the cygwin getrusage. This will take a little longer, but will solve the
problem without any messy #ifdef tests.

 
> What about to add in tools.c a section like this:
>
> #ifdef _SQUID_CYGWIN_
> #undef getrusage
> #define getrusage WIN32_getrusage
> #endif

I don't like this - see above :].

...
> Let to know to me Your opinion.

My call would be to let cygwin not have that info until cygwin
1.3.4/1.3.5 is released. I need to get that socket handling issue you
reported solved in cygwin before squid will be stable on the recent
builds. (It's affecting apache on cygwin too, so it's not a squid
issue).

Rob
Received on Sun Oct 21 2001 - 04:55:41 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:34 MST