diff options
author | Heena Sirwani <heenasirwani@gmail.com> | 2014-10-29 06:31:50 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-10-29 10:15:40 -0400 |
commit | dbe7aa622db96b5cd601f59d09c4f00b98b76079 (patch) | |
tree | 303b3f8f88b40b4529f3a37ea20ca8f4f46694e5 /include | |
parent | 9e3680b1750b9a62680b0262c9f438de98b77655 (diff) |
timekeeping: Provide y2038 safe accessor to the seconds portion of CLOCK_REALTIME
ktime_get_real_seconds() is the replacement function for get_seconds()
returning the seconds portion of CLOCK_REALTIME in a time64_t. For
64bit the function is equivivalent to get_seconds(), but for 32bit it
protects the readout with the timekeeper sequence count. This is
required because 32-bit machines cannot access 64-bit tk->xtime_sec
variable atomically.
[tglx: Massaged changelog and added docbook comment ]
Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Reviewed-by: Arnd Bergman <arnd@arndb.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: opw-kernel@googlegroups.com
Link: http://lkml.kernel.org/r/7adcfaa8962b8ad58785d9a2456c3f77d93c0ffb.1414578445.git.heenasirwani@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/timekeeping.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 115d55e11bc9..91454dea2bc6 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
@@ -29,6 +29,7 @@ struct timespec get_monotonic_coarse(void); | |||
29 | extern void getrawmonotonic(struct timespec *ts); | 29 | extern void getrawmonotonic(struct timespec *ts); |
30 | extern void ktime_get_ts64(struct timespec64 *ts); | 30 | extern void ktime_get_ts64(struct timespec64 *ts); |
31 | extern time64_t ktime_get_seconds(void); | 31 | extern time64_t ktime_get_seconds(void); |
32 | extern time64_t ktime_get_real_seconds(void); | ||
32 | 33 | ||
33 | extern int __getnstimeofday64(struct timespec64 *tv); | 34 | extern int __getnstimeofday64(struct timespec64 *tv); |
34 | extern void getnstimeofday64(struct timespec64 *tv); | 35 | extern void getnstimeofday64(struct timespec64 *tv); |