[PATCH 4/6] backport-include: backport ktime_get_boottime_seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>
---
 backport/backport-include/linux/timekeeping.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
index 30f9b7a9..56c3deec 100644
--- a/backport/backport-include/linux/timekeeping.h
+++ b/backport/backport-include/linux/timekeeping.h
@@ -24,6 +24,13 @@ static inline u64 ktime_get_boot_ns(void)
 }
 #endif /* < 3.17 */
 
+#if LINUX_VERSION_IS_LESS(4,18,0)
+static inline time64_t ktime_get_boottime_seconds(void)
+{
+	return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC);
+}
+#endif /* < 4.18 */
+
 #if LINUX_VERSION_IS_LESS(3,19,0)
 static inline time64_t ktime_get_seconds(void)
 {
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux