From 8db1ef3eee67e40643eaf017a62d7f2c23473e9b 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. Reviewed-on: https://gerrit.openafs.org/14216 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 9a5790cfbb8e7b1a4a2e832911c71da49f604c20) Change-Id: I223d8407bf28e91ffb2669013c089053ae93feb3 Reviewed-on: https://gerrit.openafs.org/14234 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand --- 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 1864cec6e..784829627 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 5e21cfdd2..acd5679ec 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -177,7 +177,7 @@ extern void osi_AttachVnode(struct vcache *, int seq); * 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; -- 2.39.5