]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Y2038: add struct __timeval64
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Thu, 7 Sep 2017 22:41:42 +0000 (00:41 +0200)
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Wed, 24 Oct 2018 10:53:27 +0000 (12:53 +0200)
Also, provide static inline functions and macros for checking
and converting between 32-bit and 64-bit timevals.

12 files changed:
bits/resource.h
include/bits/types/struct_timeval64.h [new file with mode: 0644]
misc/sys/select.h
resource/bits/types/struct_rusage.h
sysdeps/unix/sysv/linux/alpha/bits/resource.h
sysdeps/unix/sysv/linux/bits/resource.h
sysdeps/unix/sysv/linux/bits/timex.h
sysdeps/unix/sysv/linux/mips/bits/resource.h
sysdeps/unix/sysv/linux/sparc/bits/resource.h
time/Makefile
time/bits/types/struct_timeval64.h [new file with mode: 0644]
time/sys/time.h

index 7693d20fed284ee1bae5cba8884da319f58e262e..c0b00bec0e7702db32aad3e5e0b7cc81ce624fb4 100644 (file)
@@ -134,6 +134,7 @@ enum __rusage_who
   };
 
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 #include <bits/types/struct_rusage.h>
 
 /* Priority limits.  */
diff --git a/include/bits/types/struct_timeval64.h b/include/bits/types/struct_timeval64.h
new file mode 100644 (file)
index 0000000..fe2ffe6
--- /dev/null
@@ -0,0 +1 @@
+#include <time/bits/types/struct_timeval64.h>
index 6dd0c83227c45c8c7c902a82d5eec603a90a136b..4183e851e3ad07b682a019e85432a4f8543f9cb9 100644 (file)
@@ -35,6 +35,7 @@
 /* Get definition of timer specification structures.  */
 #include <bits/types/time_t.h>
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 #ifdef __USE_XOPEN2K
 # include <bits/types/struct_timespec.h>
 #endif
index 5ff94296ad52cd4a73b55231ceba53f0f4420ec8..43d308c0047305fe7eedd3aa037648ade3c63c07 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <bits/types.h>
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 
 /* Structure which says how much of each resource has been used.  If
    the system does not keep track of a particular value, the struct
index dddcb0f0493bc81cfc5b7bb920f430de1785cf1f..b602f5684d2a97e60ea5e37c8ca8c7211e617deb 100644 (file)
@@ -176,6 +176,7 @@ enum __rusage_who
 };
 
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 #include <bits/types/struct_rusage.h>
 
 /* Priority limits.  */
index fafbadf94fcbc3ddeec10b8331994d0de6117a44..1f42d0d7d73a887f20957b3ce8abeef8b8776283 100644 (file)
@@ -176,6 +176,7 @@ enum __rusage_who
 };
 
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 #include <bits/types/struct_rusage.h>
 
 /* Priority limits.  */
index 1dbcc0b57d608900c3707b333135dc262e36d216..d3c16ecf97d02aa3887fe899d618e03a3e98e520 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <bits/types.h>
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 
 /* These definitions from linux/timex.h as of 3.18.  */
 
index 89d878820b16899c8d637c304671afef4624e88b..ba46c0b98394419bc2e3981111f786b9052922ce 100644 (file)
@@ -184,6 +184,7 @@ enum __rusage_who
 };
 
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 #include <bits/types/struct_rusage.h>
 
 /* Priority limits.  */
index ee5c26e8c42af70fcc68c11f5a31dc6eefb84e33..1c88169a188e4056f4b7d5bc17e8e06d39e90f6f 100644 (file)
@@ -192,6 +192,7 @@ enum __rusage_who
 };
 
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 #include <bits/types/struct_rusage.h>
 
 /* Priority limits.  */
index ec3e39dcea75ee51288314640660a3a36c7be706..f784fa186ebf2b58c084f57186aa2cf1264cc5c9 100644 (file)
@@ -27,7 +27,7 @@ headers := time.h sys/time.h sys/timeb.h bits/time.h                  \
           bits/types/struct_itimerspec.h                               \
           bits/types/struct_timespec.h bits/types/struct_timeval.h     \
           bits/types/struct_tm.h bits/types/timer_t.h                  \
-          bits/types/time_t.h
+          bits/types/time_t.h                                          \
 
 routines := offtime asctime clock ctime ctime_r difftime \
            gmtime localtime mktime time                 \
diff --git a/time/bits/types/struct_timeval64.h b/time/bits/types/struct_timeval64.h
new file mode 100644 (file)
index 0000000..e4966ea
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __timeval64_defined
+#define __timeval64_defined 1
+
+#include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct __timeval64
+{
+  __time64_t tv_sec;           /* Seconds */
+  __int64_t tv_usec;           /* Microseconds */
+};
+#endif
index 4166a5b10f2d0b9f1eb9ee5db0c06500e3646e0c..4e6255e34d4464a669a9fb7da3723a544b026095 100644 (file)
@@ -23,6 +23,7 @@
 #include <bits/types.h>
 #include <bits/types/time_t.h>
 #include <bits/types/struct_timeval.h>
+#include <bits/types/struct_timeval64.h>
 
 #ifndef __suseconds_t_defined
 typedef __suseconds_t suseconds_t;