Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: clisp AT peterb DOT org DOT uk Subject: getrusage and Win98SE Date: 14 Apr 2002 20:06:43 +0100 Message-ID: Lines: 32 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 . 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/