public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] y2038: Add __USE_TIME_BITS64 support for struct timespec
@ 2021-06-15 14:06 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2021-06-15 14:06 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c606975bd09e9dcbf9901b1b57ab848e26005e85

commit c606975bd09e9dcbf9901b1b57ab848e26005e85
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Feb 17 16:19:45 2021 -0300

    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>

Diff:
---
 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 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-15 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 14:06 [glibc] y2038: Add __USE_TIME_BITS64 support for struct timespec Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).