In Kernel commit
e4b92b108c6cd6b311e4b6e85d6a87a34599a6e3 the
do_gettimeofday function was removed.
According to the Linux Documentation/core-api/timekeeping.rst
ktime_get_real_ts64 is the direct replacement for do_gettimeofday
Updated the macro osi_GetTime to use ktime_get_real_ts64 if it is
available.
Change-Id: I7fcd49958de83a6a040e40bd310a228247c481b2
Reviewed-on: https://gerrit.openafs.org/13433
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
# define osi_Time() (xtime.tv_sec)
#endif
-
-
-#ifdef AFS_LINUX_64BIT_KERNEL
+#if defined(HAVE_LINUX_KTIME_GET_REAL_TS64)
+# define osi_GetTime(V) \
+ do { \
+ struct timespec64 __afs_tv; \
+ ktime_get_real_ts64(&__afs_tv); \
+ (V)->tv_sec = (afs_int32)__afs_tv.tv_sec; \
+ (V)->tv_usec = (afs_int32)__afs_tv.tv_nsec / 1000; \
+ } while(0)
+#elif defined(AFS_LINUX_64BIT_KERNEL)
# define osi_GetTime(V) \
do { \
struct timeval __afs_tv; \
[#include <linux/ktime.h>],
[struct timespec64 *s;
ktime_get_coarse_real_ts64(s);])
+AC_CHECK_LINUX_FUNC([ktime_get_real_ts64],
+ [#include <linux/ktime.h>],
+ [struct timespec64 *s;
+ ktime_get_real_ts64(s);])
AC_CHECK_LINUX_FUNC([locks_lock_file_wait],
[#include <linux/fs.h>],
[locks_lock_file_wait(NULL, NULL);])