aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
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 /sys/sys
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 'sys/sys')
-rw-r--r--sys/sys/_clock_id.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/_clock_id.h b/sys/sys/_clock_id.h
index f0a25ce0f3f1..a88eb063122f 100644
--- a/sys/sys/_clock_id.h
+++ b/sys/sys/_clock_id.h
@@ -85,6 +85,15 @@
#define CLOCK_PROCESS_CPUTIME_ID 15
#endif /* __POSIX_VISIBLE >= 199309 */
+/*
+ * Linux compatible names.
+ */
+#if __BSD_VISIBLE
+#define CLOCK_BOOTTIME CLOCK_UPTIME
+#define CLOCK_REALTIME_COARSE CLOCK_REALTIME_FAST
+#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST
+#endif
+
#if __BSD_VISIBLE
#define TIMER_RELTIME 0x0 /* relative timer */
#endif