From c606975bd09e9dcbf9901b1b57ab848e26005e85 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 17 Feb 2021 16:19:45 -0300 Subject: [PATCH] y2038: Add __USE_TIME_BITS64 support for struct timespec The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- time/bits/types/struct_timespec.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index d11c69c..489e811 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -4,15 +4,20 @@ #include #include +#include /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { +#ifdef __USE_TIME_BITS64 + __time64_t tv_sec; /* Seconds. */ +#else __time_t tv_sec; /* Seconds. */ +#endif #if __WORDSIZE == 64 \ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ - || __TIMESIZE == 32 + || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) __syscall_slong_t tv_nsec; /* Nanoseconds. */ #else # if __BYTE_ORDER == __BIG_ENDIAN -- 2.7.4