On Mon, 26 Feb 2018 19:12:20 -0600, Scott Cheloha wrote:
> Reading the latest POSIX description for times(3):
> > Upon successful completion, times() shall return the elapsed
> > real time, in clock ticks, since an arbitrary point in the past
> > (for example, system start-up time). This point does not change
> > from one invocation of times() within the process to another.
> it seems to me that times(3) is meant to return a monotonically
> increasing value.
> All other uses I've ever seen don't suggest a different understanding
> by other application developers. There aren't many left in base, but
> gnu/usr.bin/gcc/gcc/timevar.c seems to support this.
> I don't have access to 1003.1-1988  (the most recent standard
> cited in times.3). Has the description changed much?
> But, so, with this patch we use CLOCK_MONOTONIC to derive the return
> value and update the manpage to reflect that. While here, add a
> RETURN VALUES section like every other library function page and reword
> things to look like other library function pages (did my best).
This is fine with me. I'd be tempted to mention that on OpenBSD
the return value is relative to system start time but I don't think
it makes much difference since it is an implementation detail.