diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-02-17 16:19:45 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-02-18 20:42:42 -0300 |
commit | 4e1c9764e5180e7f54567b432e13a2b5db5d3228 (patch) | |
tree | f57b0cffedb3159a6678e0ba4bd78be58644c605 | |
parent | bf82b1bdd47653fba40411af27026bc155aefe24 (diff) | |
download | glibc-4e1c9764e5180e7f54567b432e13a2b5db5d3228.tar.gz |
y2038: Add __USE_TIME_BITS64 support for struct timespec
The __USE_TIME_BITS64 is not defined internally yet.
-rw-r--r-- | time/bits/types/struct_timespec.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index d11c69cfd3..4fe47a0d25 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -1,18 +1,22 @@ -/* NB: Include guard matches what <linux/time.h> uses. */ -#ifndef _STRUCT_TIMESPEC -#define _STRUCT_TIMESPEC 1 +#ifndef __struct_timespec_defined +#define __struct_timespec_defined 1 #include <bits/types.h> #include <bits/endian.h> +#include <bits/types/time_t.h> /* 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 |