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 /time | |
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.
Diffstat (limited to 'time')
-rw-r--r-- | time/Makefile | 2 | ||||
-rw-r--r-- | time/bits/types/struct_timeval64.h | 13 | ||||
-rw-r--r-- | time/sys/time.h | 1 |
3 files changed, 15 insertions, 1 deletions
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; |