Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug with for and time
- X-seq: zsh-workers 20465
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: bug with for and time
- Date: Thu, 7 Oct 2004 10:25:39 -0500
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <200410070937.i979bRaK027278@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <41616CDC.8020701@xxxxxxxxxxxxxxxx> <200410041610.i94GAl92005952@xxxxxxxxxxxxxx> <20041005113848.6f3715bd@xxxxxxxxxxxxxxxxxxxxx> <20041005181820.GC30419@xxxxxxxxxxxxxxxx> <20041006134818.089f5218@xxxxxxxxxxxxxxxxxxxxx> <200410061706.i96H6LTO010315@xxxxxxxxxxxxxx> <20041006175328.GB87634@xxxxxxxxxxxxxxxx> <200410070937.i979bRaK027278@xxxxxxxxxxxxxx>
In the last episode (Oct 07), Peter Stephenson said:
> I can vaguely remember that the getrusage() fields which didn't
> correspond to times were dropped when we switched to autoconf, simply
> because it became hard to test for all the fields. I didn't notice
> getrusage() disappearing entirely then, but it certainly must have at
> some point.
I did some mailinglist searches, and back in 1999, workers-2526 says
that getrusage was removed because it wasn't POSIX and the autoconf
test was too complex. It is now, though, and was in SUS as far back as
1997. Unfortunately, only two struct members are defined:
struct timeval ru_utime User time used.
struct timeval ru_stime System time used.
Fortunately, the remaining members defined by AIX, FreeBSD, Linux,
Solaris, and Tru64 are identical. Solaris doesn't fill in ru_ixrss or
ru_isrss (%X and %D), but they are in the struct. Testing for each
member individually if you wanted to wouldn't be hard, anyway. One
AC_CHECK_MEMBERS call with 14 arguments is all that's needed, plus the
appropriate #if defined checks around each resource in the TIMEFMT
expansion code.
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author