From 9a5790cfbb8e7b1a4a2e832911c71da49f604c20 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Mon, 18 May 2020 17:20:26 -0400 Subject: [PATCH] LINUX 5.6: define osi_timeval32_t for 32-bit Linux For 32-bit Linux (e.g., arch i586), AFS_LINUX_64BIT_KERNEL is not defined, so osi_timeval32_t is defined as a typedef of the native 'timeval'. However, as of commit c766d1472c70d25ad475cf56042af1652e792b23 "y2038: hide timeval/timespec/itimerval/itimerspec types" (Linux 5.6), the native timeval struct is no longer available. On such a kernel, the OpenAFS build will fail because osi_timeval32_t is not properly defined. Instead, add new conditionals to properly define osi_timeval32_t for this platform. Change-Id: I1eddeeb3651dcd3c55920ab1d2ad2838f4729bdd Reviewed-on: https://gerrit.openafs.org/14216 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/afs/LINUX/osi_machdep.h | 2 +- src/afs/afs_osi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index ae72ae4..dc7c344 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -104,7 +104,7 @@ static inline time_t osi_Time(void) { (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) +#elif defined(AFS_LINUX_64BIT_KERNEL) || !defined(HAVE_LINUX_TIME_T) # define osi_GetTime(V) \ do { \ struct timeval __afs_tv; \ diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 0571bda..1e3e89e 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -186,7 +186,7 @@ extern int osi_vnhold(struct vcache *); * In 64 bit HP-UX the timeval structure has a 64 bit member. */ -#if defined(AFS_HPUX_ENV) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64)) +#if defined(AFS_HPUX_ENV) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_LINUX26_ENV) && !defined(HAVE_LINUX_TIME_T)) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64)) typedef struct { afs_int32 tv_sec; afs_int32 tv_usec; -- 1.9.4