diff options
author | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-09-08 00:41:42 +0200 |
---|---|---|
committer | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2018-10-24 12:53:27 +0200 |
commit | 8ea072767dc028b00062944d79c9d1fcee44c676 (patch) | |
tree | 1fe6088c48612c6b9e06fef42db5e953b9e42626 | |
parent | ac7c4beb24181ffb76aad962956a55534a7d58ae (diff) | |
download | glibc-8ea072767dc028b00062944d79c9d1fcee44c676.tar.gz glibc-8ea072767dc028b00062944d79c9d1fcee44c676.tar.xz glibc-8ea072767dc028b00062944d79c9d1fcee44c676.zip |
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.h | 1 | ||||
-rw-r--r-- | include/bits/types/struct_timeval64.h | 1 | ||||
-rw-r--r-- | misc/sys/select.h | 1 | ||||
-rw-r--r-- | resource/bits/types/struct_rusage.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/bits/resource.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/resource.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/timex.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/bits/resource.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/bits/resource.h | 1 | ||||
-rw-r--r-- | time/Makefile | 2 | ||||
-rw-r--r-- | time/bits/types/struct_timeval64.h | 13 | ||||
-rw-r--r-- | time/sys/time.h | 1 |
12 files changed, 24 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 6dd0c83227..4183e851e3 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> #endif diff --git a/resource/bits/types/struct_rusage.h b/resource/bits/types/struct_rusage.h index 5ff94296ad..43d308c004 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. If the system does not keep track of a particular value, the struct 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 ec3e39dcea..f784fa186e 100644 --- a/time/Makefile +++ b/time/Makefile @@ -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 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; |