Mail Archives: cygwin/2002/04/14/15:08:00
Hi,
As is already known, getrusage provides no information under Win98SE and I
presume all Win9x and maybe WinME, WinXP too. I have read here that it is
only supported on WinNT but that statement is from Jan 2001.
I am fixing some Cygwin problems with Clisp <http://clisp.cons.org>. Now,
Clisp uses getrusage when it is defined to get user and system time.
However, getrusage gives no indication that it provides no useful
information for Win98, so Clisp uses it and then reports 0.0 for user and
system time when measuring time of an evaluated form, which is wrong.
For now, I am using times() from sys/times.h, as a replacement for
getrusage, to gather the user time. times() does fill in the utime field,
though it is probably wall time rather than user time.
I have two questions.
If times() is providing wall time, then it is not really conforming as it's
supposed to be providing CPU time charged. Is this acceptable?
If getrusage() provides no information, wouldn't it be better if getrusage()
returned -1 to indicate that?
Thus, on WinNT, and those that work, fill in the rusage struct and return
0. For those that don't, then return -1. Alternatively, since times() does
it, fill in the ru_utime field in the same way as times().
What do you think?
Peter
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -