aboutsummaryrefslogtreecommitdiffstats
path: root/main/dahdi-linux-lts/kernel-compat-5.0.patch
blob: 3729db3c0cd5d7adc60e3686962eae8f856246f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1695,4 +1695,15 @@
 
 #endif /* DAHDI_PRINK_MACROS_USE_debug */
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+static inline void do_gettimeofday(struct timeval *tv)
+{
+	struct timespec64 now;
+
+	ktime_get_real_ts64(&now);
+	tv->tv_sec = now.tv_sec;
+	tv->tv_usec = now.tv_nsec/1000;
+}
+#endif
+
 #endif /* _DAHDI_KERNEL_H */