Re: WIN32 PSAPI patch

From: Guido Serassio <serassio@dont-contact.us>
Date: Sun, 21 Oct 2001 11:40:40 +0200

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.

> >
> > Yes, I've found that Cygwin lacks theses process memory informations.
> > But, I have just checked the latest cygwin1.dll with the MS Dependency
> > Walker tool, and I haven't found any reference to psapi.dll on it.
> > Are You sure that Cygwin uses it ?
> > IMO, Cygwin lacks theses process memory informations because doesn't
>use
> > psapi.
>
>Cygwin autoloads such dlls as PSAPI via a little bit of assembly
>language. This allows it to use NT only code on NT, and still run on 9x
>correctly. Dependency walker doesn't show half the libraries actually
>used by cygwin1.dll.

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 ...

> > >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.

What about to add in tools.c a section like this:

#ifdef _SQUID_CYGWIN_
#undef getrusage
#define getrusage WIN32_getrusage
#endif

The WIN32_getrusage wrapper function goes on win32.c with code now in
tools.c, and on Cygwin call getrusage and after fix the memory info with psapi.
When Cygwin lacks of info are resolved, the only thing to make is to remove
the previous #ifdef.

Let to know to me Your opinion.

Guido

-
=======================================================
Serassio Guido
Via Albenga, 11/4 10134 - Torino - ITALY
Tel. : +39.011.610749
E-mail: serassio@interfree.it
         serassio@libero.it
WWW: http://www.serassio.it
Received on Sun Oct 21 2001 - 03:40:45 MDT

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