public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] time.h: Introduce Linux-specific CLOCK id values Date: Thu, 29 Nov 2018 10:12:00 -0000 [thread overview] Message-ID: <20181129101246.115412.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f4d6ef2d417e0fc10a159ab64827f837c9a3be84 commit f4d6ef2d417e0fc10a159ab64827f837c9a3be84 Author: Corinna Vinschen <corinna@vinschen.de> Date: Wed Nov 28 22:49:30 2018 +0100 time.h: Introduce Linux-specific CLOCK id values - Add CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_RAW, CLOCK_MONOTONIC_COARSE and CLOCK_BOOTTIME - Guard new values with __GNU_VISIBLE - Add CLOCK_REALTIME_COARSE as (clockid_t) 0 for simplicity (It allows to have all values < 8 and so be used as array index into an array of clocks) - Fix macro bracketing Signed-off-by: Corinna Vinschen <corinna@vinschen.de> Diff: --- newlib/libc/include/time.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index a2efcc1..bd35d0e 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -251,7 +251,11 @@ extern "C" { /* Manifest Constants, P1003.1b-1993, p. 262 */ -#define CLOCK_REALTIME (clockid_t)1 +#if __GNU_VISIBLE +#define CLOCK_REALTIME_COARSE ((clockid_t) 0) +#endif + +#define CLOCK_REALTIME ((clockid_t) 1) /* Flag indicating time is "absolute" with respect to the clock associated with a time. */ @@ -266,7 +270,7 @@ extern "C" { the identifier of the CPU_time clock associated with the PROCESS making the function call. */ -#define CLOCK_PROCESS_CPUTIME_ID (clockid_t)2 +#define CLOCK_PROCESS_CPUTIME_ID ((clockid_t) 2) #endif @@ -276,7 +280,7 @@ extern "C" { the identifier of the CPU_time clock associated with the THREAD making the function call. */ -#define CLOCK_THREAD_CPUTIME_ID (clockid_t)3 +#define CLOCK_THREAD_CPUTIME_ID ((clockid_t) 3) #endif @@ -286,7 +290,17 @@ extern "C" { * as a clock whose value cannot be set via clock_settime() and which * cannot have backward clock jumps. */ -#define CLOCK_MONOTONIC (clockid_t)4 +#define CLOCK_MONOTONIC ((clockid_t) 4) + +#if __GNU_VISIBLE + +#define CLOCK_MONOTONIC_RAW ((clockid_t) 5) + +#define CLOCK_MONOTONIC_COARSE ((clockid_t) 6) + +#define CLOCK_BOOTTIME ((clockid_t) 7) + +#endif #endif
reply other threads:[~2018-11-29 10:12 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20181129101246.115412.qmail@sourceware.org \ --to=corinna@sourceware.org \ --cc=newlib-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).