summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2017-09-08 00:41:42 +0200
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-06-13 09:06:53 +0200
commitb44484502f07f79ce7ea7461a22fcc25006f1a8b (patch)
treea6eb66287c0792edb88303f85044f8290b7d46ac
parentca2cb8c490e8cf3dd6b936cdde751b5bcbeb0ca6 (diff)
downloadglibc-b44484502f07f79ce7ea7461a22fcc25006f1a8b.tar.gz
Y2038: add struct __timeval64
Also, provide static inline functions and macros for checking and converting between 32-bit and 64-bit timevals.
-rw-r--r--bits/resource.h1
-rw-r--r--include/bits/types/struct_timeval64.h1
-rw-r--r--misc/sys/select.h1
-rw-r--r--resource/bits/types/struct_rusage.h1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/resource.h1
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h1
-rw-r--r--sysdeps/unix/sysv/linux/bits/timex.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/resource.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/resource.h1
-rw-r--r--time/Makefile3
-rw-r--r--time/bits/types/struct_timeval64.h13
-rw-r--r--time/sys/time.h1
12 files changed, 25 insertions, 1 deletions
diff --git a/bits/resource.h b/bits/resource.h
index 7693d20fed..c0b00bec0e 100644
--- a/bits/resource.h
+++ b/bits/resource.h
@@ -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
index 0000000000..fe2ffe6430
--- /dev/null
+++ b/include/bits/types/struct_timeval64.h
@@ -0,0 +1 @@
+#include <time/bits/types/struct_timeval64.h>
diff --git a/misc/sys/select.h b/misc/sys/select.h
index 1285dc4a8b..060e7f4876 100644
--- a/misc/sys/select.h
+++ b/misc/sys/select.h
@@ -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>
# include <bits/types/struct_timespec64.h>
diff --git a/resource/bits/types/struct_rusage.h b/resource/bits/types/struct_rusage.h
index 5dc0916aa7..bb2ecb2d38 100644
--- a/resource/bits/types/struct_rusage.h
+++ b/resource/bits/types/struct_rusage.h
@@ -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. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index dddcb0f049..b602f5684d 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -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. */
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index fafbadf94f..1f42d0d7d7 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -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. */
diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
index 1dbcc0b57d..d3c16ecf97 100644
--- a/sysdeps/unix/sysv/linux/bits/timex.h
+++ b/sysdeps/unix/sysv/linux/bits/timex.h
@@ -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. */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index 89d878820b..ba46c0b983 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -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. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/resource.h b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
index ee5c26e8c4..1c88169a18 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
@@ -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. */
diff --git a/time/Makefile b/time/Makefile
index 61b8904dfc..5e76bc0156 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -27,7 +27,8 @@ 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/struct_timespec64.h
+ bits/types/time_t.h bits/types/struct_timespec64.h \
+ bits/types/struct_timeval64.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
index 0000000000..e4966ea525
--- /dev/null
+++ b/time/bits/types/struct_timeval64.h
@@ -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
diff --git a/time/sys/time.h b/time/sys/time.h
index 4166a5b10f..4e6255e34d 100644
--- a/time/sys/time.h
+++ b/time/sys/time.h
@@ -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;