need confirmation of documentation problem for times(3)
freebsd-questions-local at be-well.ilk.org
Fri Apr 4 14:45:10 UTC 2008
"Viktor Štujber" <viktor.stujber at gmail.com> writes:
> I have been forwarded to this list from a docs bugreport
> * http://www.freebsd.org/cgi/query-pr.cgi?pr=122359
> and I am looking for confirmation of this issue.
>> The freebsd manpages for 'clock_t times(struct tms *tp)' say the following:
>> The times() function returns the value of time in CLK_TCK's of a second since
>> 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal Time.
>> But after letting a sample C program print the returned value, it matches
>> the system's uptime (in clock ticks).
>> I would like to ask the bsd devs to clarify whether this is
>> a documentation problem, or an implementation problem.
According to /usr/src/lib/libc/gen/times.c (and my understanding of
the way it uses clock_gettime()), it looks like the documentation
matches what the code is intended to do. If there is a problem, it is
probably in clock_gettime().
Note that times(2) is a deprecated function, and *either* behaviour is
acceptable according to the standards which applied before it was
More information about the freebsd-questions