From 155f15118a77d2aeab7b177ada78c848778d7d80 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 30 Jul 2021 17:11:43 -0600 Subject: 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 --- sys/sys/_clock_id.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/sys') 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 -- cgit v1.2.3