aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-02-17 16:19:45 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-15 10:42:11 -0300
commitc606975bd09e9dcbf9901b1b57ab848e26005e85 (patch)
tree2b5603ef4f2763719b355a34d05d951e012ef887
parentbdc4782744df73a8c0559985c54b5b6b9c7a4a74 (diff)
downloadglibc-c606975bd09e9dcbf9901b1b57ab848e26005e85.tar
glibc-c606975bd09e9dcbf9901b1b57ab848e26005e85.tar.gz
glibc-c606975bd09e9dcbf9901b1b57ab848e26005e85.tar.bz2
glibc-c606975bd09e9dcbf9901b1b57ab848e26005e85.zip
y2038: Add __USE_TIME_BITS64 support for struct timespec
The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
-rw-r--r--time/bits/types/struct_timespec.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h
index d11c69cfd3..489e81136d 100644
--- a/time/bits/types/struct_timespec.h
+++ b/time/bits/types/struct_timespec.h
@@ -4,15 +4,20 @@
#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