diff options
Diffstat (limited to 'backport/backport-include/linux/timekeeping.h')
-rw-r--r-- | backport/backport-include/linux/timekeeping.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h new file mode 100644 index 00000000..4fb39b2c --- /dev/null +++ b/backport/backport-include/linux/timekeeping.h @@ -0,0 +1,21 @@ +#ifndef __BACKPORT_TIMKEEPING_H +#define __BACKPORT_TIMKEEPING_H +#include <linux/version.h> +#include <linux/types.h> + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) +#include_next <linux/timekeeping.h> +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +static inline time64_t ktime_get_seconds(void) +{ + struct timespec t; + + ktime_get_ts(&t); + + return t.tv_sec; +} +#endif + +#endif /* __BACKPORT_TIMKEEPING_H */ |