[PATCH 09/14] header: timekeeping.h: Add ktime_get_real_seconds()

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

 



This function was added in commit dbe7aa622db96b ("timekeeping: Provide
y2038 safe accessor to the seconds portion of CLOCK_REALTIME") and is
used by multiple realtek drivers.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/linux/timekeeping.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
index 0b9c649a..c108645f 100644
--- a/backport/backport-include/linux/timekeeping.h
+++ b/backport/backport-include/linux/timekeeping.h
@@ -33,6 +33,15 @@ static inline time64_t ktime_get_seconds(void)
 
 	return t.tv_sec;
 }
+
+static inline time64_t ktime_get_real_seconds(void)
+{
+	struct timeval tv;
+
+	do_gettimeofday(&tv);
+
+	return tv.tv_sec;
+}
 #endif
 
 #endif /* __BACKPORT_TIMEKEEPING_H */
-- 
2.11.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