--- 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 */