FreeBSD Bugzilla – Attachment 226198 Details for
Bug 256941
Add CLOCK_*_COARSE compat defines for Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch for defines
clock.diff (text/plain), 2.35 KB, created by
Warner Losh
on 2021-07-03 17:15:25 UTC
(
hide
)
Description:
Proposed patch for defines
Filename:
MIME Type:
Creator:
Warner Losh
Created:
2021-07-03 17:15:25 UTC
Size:
2.35 KB
patch
obsolete
>commit 48d3c81a263058003f6f16e5c06418ca403720b1 >Author: Warner Losh <imp@FreeBSD.org> >Date: Thu Jul 1 14:11:07 2021 -0600 > > clock_gettime: Add aliases for CLOCK_{REALTIME,MONOTONIC}_COARSE > > Linux standardized what we call CLOCK_{REALTIME,MONOTONIC}_FAST as > CLOCK_{REALTIME,MONOTONIC}_COARSE. Add aliases to time.h and document > these new aliases in clock_gettime(2). > > Sponsored by: Netflix > >diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2 >index 4552819ea902..5d7d2240a938 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,10 +68,12 @@ 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 >@@ -104,6 +106,11 @@ Similarly, > .Fa CLOCK_UPTIME_PRECISE > are used to get the most exact value as possible, at the expense of > execution time. >+Finally, the clock IDs >+.Fa CLOCK_REALTIME_COARSE , >+.Fa CLOCK_MONOTONIC_COARSE >+are aliases of corresponding IDs with _FAST suffix for compatibility with other >+systems. > .Pp > The structure pointed to by > .Fa tp >diff --git a/sys/sys/time.h b/sys/sys/time.h >index a48aa3fe5548..9fbae544cb27 100644 >--- a/sys/sys/time.h >+++ b/sys/sys/time.h >@@ -482,12 +482,15 @@ struct clockinfo { > #ifndef CLOCK_MONOTONIC > #define CLOCK_MONOTONIC 4 > #define CLOCK_UPTIME 5 /* FreeBSD-specific. */ >+#define CLOCK_BOOTTIME CLOCK_UPTIME /* Linux compat */ > #define CLOCK_UPTIME_PRECISE 7 /* FreeBSD-specific. */ > #define CLOCK_UPTIME_FAST 8 /* FreeBSD-specific. */ > #define CLOCK_REALTIME_PRECISE 9 /* FreeBSD-specific. */ > #define CLOCK_REALTIME_FAST 10 /* FreeBSD-specific. */ >+#define CLOCK_REALTIME_COARSE CLOCK_REALTIME_FAST /* Linux compat */ > #define CLOCK_MONOTONIC_PRECISE 11 /* FreeBSD-specific. */ > #define CLOCK_MONOTONIC_FAST 12 /* FreeBSD-specific. */ >+#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST /* Linux compat */ > #define CLOCK_SECOND 13 /* FreeBSD-specific. */ > #define CLOCK_THREAD_CPUTIME_ID 14 > #define CLOCK_PROCESS_CPUTIME_ID 15
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 256941
:
226174
|
226198
|
226255
|
226256
|
226294