From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21333 invoked by alias); 14 Apr 2002 19:07:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 21322 invoked from network); 14 Apr 2002 19:07:16 -0000 Received: from unknown (HELO mta01-svc.ntlworld.com) (62.253.162.41) by sources.redhat.com with SMTP; 14 Apr 2002 19:07:16 -0000 Received: from proxyplus.universe ([62.255.68.99]) by mta01-svc.ntlworld.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020414190713.FRUK14788.mta01-svc.ntlworld.com@proxyplus.universe> for ; Sun, 14 Apr 2002 20:07:13 +0100 Received: from 127.0.0.1 by Proxy+; Sun, 14 Apr 2002 19:06:44 GMT To: cygwin@cygwin.com From: clisp@peterb.org.uk Subject: getrusage and Win98SE Date: Sun, 14 Apr 2002 12:35:00 -0000 Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg00750.txt.bz2 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/