LINUX 5.6: define osi_timeval32_t for 32-bit Linux 16/14216/6
authorMark Vitale <mvitale@sinenomine.net>
Mon, 18 May 2020 21:20:26 +0000 (17:20 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 28 May 2020 00:28:52 +0000 (20:28 -0400)
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 <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/LINUX/osi_machdep.h
src/afs/afs_osi.h

index ae72ae4..dc7c344 100644 (file)
@@ -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;                              \
index 0571bda..1e3e89e 100644 (file)
@@ -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;