Re: WIN32 PSAPI patch

From: Robert Collins <robert.collins@dont-contact.us>
Date: Sun, 21 Oct 2001 17:31:21 +1000

----- Original Message -----
From: "Guido Serassio" <serassio@libero.it>
To: <squid-dev@squid-cache.org>
Sent: Sunday, October 21, 2001 2:52 AM
Subject: WIN32 PSAPI patch

> Hi,
>
> This is the second WIN32 patch against HEAD.
>
> This code add support for automatic use of PSAPI.DLL when available,
adding
> WIN32 process memory informations not available on Cygwin.
>
> Anybody can merge this in HEAD ?
>
> Guido

This one looks suspect. A few questions:
1)
+ * You can't rename open files on Microsoft "operating systems"
+ * so we close before renaming.
+ */
+#ifdef _SQUID_MSWIN_
+ if (debug_log != stderr)
+ fclose(debug_log);
+#endif

this looks like to would affect cygwin too... Do you know if it does or
does not affect cygwin?

2)

+#ifndef _SQUID_MSWIN_
getrusage(RUSAGE_SELF, r);
+#endif

Should be
#if HAVE_GETRUSAGE
getrusage...
endif

so that if someone has a usuable getrusage on win32 they can use it.

3) I note that you overwrite the ru_macrsss and ru_majflt on Cygwin on
NT platforms - IIRC Cygwin alrready uses PSAPI to provide this
information, so you are in effect getting it twice. If you've noted that
cygwin doesn't return this info, then that part is fine. Long term I'll
get a fix into Cygwin to provide that seamlessly though.

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.

Rob
Received on Sun Oct 21 2001 - 01:28:01 MDT

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