Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug with for and time

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

Messages sorted by: Reverse Date, Date, Thread, Author