* getrusage and Win98SE
@ 2002-04-14 12:35 clisp
0 siblings, 0 replies; only message in thread
From: clisp @ 2002-04-14 12:35 UTC (permalink / raw)
To: cygwin
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/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-14 19:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-14 12:35 getrusage and Win98SE clisp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).