aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-07-30 23:11:43 +0000
committerWarner Losh <imp@FreeBSD.org>2021-07-30 23:20:22 +0000
commit155f15118a77d2aeab7b177ada78c848778d7d80 (patch)
tree482dcea468cf06a0361e6c0ace7ae79df2fb6162 /lib
parent7b797ba27a714594dac910035d857e653d566b19 (diff)
downloadsrc-155f15118a77d2aeab7b177ada78c848778d7d80.tar.gz
src-155f15118a77d2aeab7b177ada78c848778d7d80.zip
clock_gettime: Add Linux aliases for CLOCK_*
Linux standardized what we call CLOCK_{REALTIME,MONOTONIC}_FAST as CLOCK_{REALTIME,MONOTONIC}_COARSE. In addition, Linux spells CLOCK_UPTIME as CLOCK_BOOTTIME. Add aliases to time.h and document these new aliases in clock_gettime(2). Reviewed by: vangyzen, kib (prior), dchagin (prior) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30988
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/clock_gettime.215
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2
index 4552819ea902..d620ed0f03f2 100644
--- a/lib/libc/sys/clock_gettime.2
+++ b/lib/libc/sys/clock_gettime.2
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 13, 2021
+.Dd July 1, 2021
.Dt CLOCK_GETTIME 2
.Os
.Sh NAME
@@ -68,14 +68,17 @@ as well as the following values:
.It Dv CLOCK_REALTIME
.It Dv CLOCK_REALTIME_PRECISE
.It Dv CLOCK_REALTIME_FAST
+.It Dv CLOCK_REALTIME_COARSE
Increments as a wall clock should.
.It Dv CLOCK_MONOTONIC
.It Dv CLOCK_MONOTONIC_PRECISE
.It Dv CLOCK_MONOTONIC_FAST
+.It Dv CLOCK_MONOTONIC_COARSE
Increments in SI seconds.
.It Dv CLOCK_UPTIME
.It Dv CLOCK_UPTIME_PRECISE
.It Dv CLOCK_UPTIME_FAST
+.It Dv CLOCK_BOOTTIME
Starts at zero when the kernel boots and increments
monotonically in SI seconds while the machine is running.
.It Dv CLOCK_VIRTUAL
@@ -104,6 +107,16 @@ Similarly,
.Fa CLOCK_UPTIME_PRECISE
are used to get the most exact value as possible, at the expense of
execution time.
+The clock IDs
+.Fa CLOCK_REALTIME_COARSE ,
+.Fa CLOCK_MONOTONIC_COARSE
+are aliases of corresponding IDs with _FAST suffix for compatibility with other
+systems.
+Finally,
+.Dv CLOCK_BOOTTIME
+is an alias for
+.Dv CLOCK_UPTIME
+for compatibility with other systems.
.Pp
The structure pointed to by
.Fa tp