On Tue, Feb 27, 2018 at 11:38:07AM -0700, Todd C. Miller wrote: > 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 [1] (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.
I want to avoid giving the reader even the slightest impression that the return value from times(3) can be used for anything but real-time interval measurement. Mentioning that the value is relative to the system start time seems to lean in that direction. What did you want to impart by documenting that? -Scott
