summaryrefslogtreecommitdiff
path: root/include/linux/timekeeping.h
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2015-07-29 15:09:43 +0300
committerJohn Stultz <john.stultz@linaro.org>2015-08-17 21:25:35 +0300
commit8758a240e2d74c5932ab51a73377e6507b7fd441 (patch)
treef430066a32f00ee1c4e434e51936067e80e618c3 /include/linux/timekeeping.h
parent19a46fe57a005a884ccb38419071f772ac2fca2b (diff)
downloadlinux-8758a240e2d74c5932ab51a73377e6507b7fd441.tar.xz
time: Introduce current_kernel_time64()
The current_kernel_time() is not year 2038 safe on 32bit systems since it returns a timespec value. Introduce current_kernel_time64() which returns a timespec64 value. Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/timekeeping.h')
-rw-r--r--include/linux/timekeeping.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 3aa72e648650..657ea03fff40 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -18,10 +18,17 @@ extern int do_sys_settimeofday(const struct timespec *tv,
* Kernel time accessors
*/
unsigned long get_seconds(void);
-struct timespec current_kernel_time(void);
+struct timespec64 current_kernel_time64(void);
/* does not take xtime_lock */
struct timespec __current_kernel_time(void);
+static inline struct timespec current_kernel_time(void)
+{
+ struct timespec64 now = current_kernel_time64();
+
+ return timespec64_to_timespec(now);
+}
+
/*
* timespec based interfaces
*/