about summary refs log tree commit diff
path: root/time/bits/types/struct_timeval.h
diff options
context:
space:
mode:
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2017-09-06 10:00:42 +0200
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-10-24 12:53:27 +0200
commit3500dd283b8e5d8a4916423855514cdbfee36eac (patch)
tree1a4a7a09096f94d446db94617b86b5b10ebe4ea7 /time/bits/types/struct_timeval.h
parentf1869e11225d9aa054fb11474887d8f109af0949 (diff)
downloadglibc-aaribaud/y2038.tar.gz
glibc-aaribaud/y2038.tar.xz
glibc-aaribaud/y2038.zip
Y2038: add _TIME_BITS support aaribaud/y2038
This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).

Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.
Diffstat (limited to 'time/bits/types/struct_timeval.h')
-rw-r--r--time/bits/types/struct_timeval.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/time/bits/types/struct_timeval.h b/time/bits/types/struct_timeval.h
index 70394ce886..e710b3786c 100644
--- a/time/bits/types/struct_timeval.h
+++ b/time/bits/types/struct_timeval.h
@@ -3,6 +3,9 @@
 
 #include <bits/types.h>
 
+/* Use the original definition for 64-bit arches
+   or when 64-bit-time by default has *not* been requested */ 
+# if __WORDSIZE > 32 || ! defined(__USE_TIME_BITS64)
 /* A time value that is accurate to the nearest
    microsecond but also has a range of years.  */
 struct timeval
@@ -10,4 +13,9 @@ struct timeval
   __time_t tv_sec;		/* Seconds.  */
   __suseconds_t tv_usec;	/* Microseconds.  */
 };
+# else
+/* Use the 64-bit-time timespec by default */
+# define timeval __timeval64
+# endif
+
 #endif