]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
time(3): Refine history in the manual page
authorGordon Bergling <gbe@FreeBSD.org>
Thu, 14 Apr 2022 08:04:14 +0000 (10:04 +0200)
committerGordon Bergling <gbe@FreeBSD.org>
Fri, 22 Apr 2022 14:36:36 +0000 (16:36 +0200)
commit6b642cf5c8742a3c307772321e0f5e4153a0b1ad
treefd45a96b6cf19f79c2f604c13769b2080f4b2daf
parent283d1b98251b7ff1e53b43d3f0264c2a087f207b
time(3): Refine history in the manual page

The time() system call first appeared in Version 1 AT&T UNIX.  Through
the Version 3 AT&T UNIX, it returned 60 Hz ticks since an epoch that
changed occasionally, because it was a 32-bit value that overflowed in a
little over 2 years.

In Version 4 AT&T UNIX the granularity of the return value was reduced to
whole seconds, delaying the aforementioned overflow until 2038.

Version 7 AT&T UNIX introduced the ftime() system call, which returned
time at a millisecond level, though retained the gtime() system call
(exposed as time() in userland).  time() could have been implemented as a
wrapper around ftime(), but that wasn't done.

4.1cBSD implemented a higher-precision time function gettimeofday() to
replace ftime() and reimplemented time() in terms of that.

Since FreeBSD 9 the implementation of time() uses
clock_gettime(CLOCK_SECOND) instead of gettimeofday() for performance
reasons.

With most valuable input from Warner (imp@).

Reviewed by: 0mp, jilles, imp
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D34751

(cherry picked from commit 3e0f3678eca7c3f296b9f702992737356f1792da)
lib/libc/gen/time.3