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

Re: Documentation of the TIMEFMT variable



2023-02-02 11:33:56 -0800, Bart Schaefer:
> On Thu, Feb 2, 2023 at 8:54 AM trillian
> <just.so.you.can.email.me@xxxxxxxxx> wrote:
> >
> > The documentation of TIMEFMT says that %M means "The  maximum memory the
> > process had in use at any time in kilobytes", but the actual value shown
> > is in megabytes. (The kernel reports it in kilobytes and zsh divides it
> > by 1024 again.)
> 
> This has been reported twice before, although after looking at the
> previous two reports I'm not sure if this is a documentation error or
> a coding error or (OS-dependently) both.  Anyone?

A portability issue. Doc is correct, but code is only correct on
Darwin/macos. GNU time's autoconf has some info on the subject
IIRC.

It's been reported many times here. See workers/45489,
workers/42363, workers/30399, workers/49145.

macos/darwin is the odd one out. ru_maxrss was already in
kibibytes in the original getrusage() implementation in BSD4.2
in 1985.

-- 
Stephane




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