diff mbox

bits/time.h: define CLOCK_BOOTTIME

Message ID 1406476086-29475-1-git-send-email-jcmvbkbc@gmail.com
State Accepted
Headers show

Commit Message

Max Filippov July 27, 2014, 3:48 p.m. UTC
CLOCK_BOOTTIME is available since Linux 2.6.39.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 libc/sysdeps/linux/common/bits/time.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Baruch Siach July 27, 2014, 4:22 p.m. UTC | #1
Hi Max,

On Sun, Jul 27, 2014 at 07:48:06PM +0400, Max Filippov wrote:
> CLOCK_BOOTTIME is available since Linux 2.6.39.
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  libc/sysdeps/linux/common/bits/time.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libc/sysdeps/linux/common/bits/time.h b/libc/sysdeps/linux/common/bits/time.h
> index b397b60..c8411df 100644
> --- a/libc/sysdeps/linux/common/bits/time.h
> +++ b/libc/sysdeps/linux/common/bits/time.h
> @@ -59,6 +59,9 @@
>  #   define CLOCK_REALTIME_COARSE	5
>  /* Monotonic system-wide clock, updated only on ticks.  */
>  #   define CLOCK_MONOTONIC_COARSE	6
> +/* Monotonic system-wide clock that includes time spent in suspension.  */
> +#   define CLOCK_BOOTTIME		7

Why not add the _ALARM clocks while at it. glibc time.h has:

/* Like CLOCK_REALTIME but also wakes suspended system.  */
#   define CLOCK_REALTIME_ALARM         8
/* Like CLOCK_BOOTTIME but also wakes suspended system.  */
#   define CLOCK_BOOTTIME_ALARM         9

Both are available since kernel v3.0.

baruch
diff mbox

Patch

diff --git a/libc/sysdeps/linux/common/bits/time.h b/libc/sysdeps/linux/common/bits/time.h
index b397b60..c8411df 100644
--- a/libc/sysdeps/linux/common/bits/time.h
+++ b/libc/sysdeps/linux/common/bits/time.h
@@ -59,6 +59,9 @@ 
 #   define CLOCK_REALTIME_COARSE	5
 /* Monotonic system-wide clock, updated only on ticks.  */
 #   define CLOCK_MONOTONIC_COARSE	6
+/* Monotonic system-wide clock that includes time spent in suspension.  */
+#   define CLOCK_BOOTTIME		7
+
 
 /* Flag to indicate time is absolute.  */
 #   define TIMER_ABSTIME		1