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>
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user