about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2017-09-08 00:42:15 +0200
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-10-24 12:53:27 +0200
commitd9a19a386245ebcfa78309709fd6394a45292601 (patch)
tree137af8288ed87c1236ceb80030e726393dabbdca
parent8dc37789c3d11b4af53cac1f3300dd4d0fd03411 (diff)
downloadglibc-d9a19a386245ebcfa78309709fd6394a45292601.tar.gz
glibc-d9a19a386245ebcfa78309709fd6394a45292601.tar.xz
glibc-d9a19a386245ebcfa78309709fd6394a45292601.zip
Y2038: add struct __timex64
-rw-r--r--include/time.h31
-rw-r--r--time/Makefile2
2 files changed, 33 insertions, 0 deletions
diff --git a/include/time.h b/include/time.h
index 5ea0aa3303..5bca4c1415 100644
--- a/include/time.h
+++ b/include/time.h
@@ -4,6 +4,7 @@
 #ifndef _ISOMAC
 # include <bits/types/locale_t.h>
 # include <bits/types/struct___timespec64.h>
+# include <bits/types/struct___timeval64.h>
 # include <stdbool.h>
 
 extern __typeof (strftime_l) __strftime_l;
@@ -32,6 +33,36 @@ libc_hidden_proto (__mktime64)
 libc_hidden_proto (__timelocal64)
 #endif
 
+/* 64-bit time version of the current struct timex */
+struct __timex64
+{
+  unsigned int modes;		/* mode selector */
+  __syscall_slong_t offset;	/* time offset (usec) */
+  __syscall_slong_t freq;	/* frequency offset (scaled ppm) */
+  __syscall_slong_t maxerror;	/* maximum error (usec) */
+  __syscall_slong_t esterror;	/* estimated error (usec) */
+  int status;			/* clock command/status */
+  __syscall_slong_t constant;	/* pll time constant */
+  __syscall_slong_t precision;	/* clock precision (usec) (ro) */
+  __syscall_slong_t tolerance;	/* clock frequency tolerance (ppm) (ro) */
+  struct __timeval64 time;	/* (read only, except for ADJ_SETOFFSET) */
+  __syscall_slong_t tick;	/* (modified) usecs between clock ticks */
+  __syscall_slong_t ppsfreq;	/* pps frequency (scaled ppm) (ro) */
+  __syscall_slong_t jitter;	/* pps jitter (us) (ro) */
+  int shift;			/* interval duration (s) (shift) (ro) */
+  __syscall_slong_t stabil;	/* pps stability (scaled ppm) (ro) */
+  __syscall_slong_t jitcnt;	/* jitter limit exceeded (ro) */
+  __syscall_slong_t calcnt;	/* calibration intervals (ro) */
+  __syscall_slong_t errcnt;	/* calibration errors (ro) */
+  __syscall_slong_t stbcnt;	/* stability limit exceeded (ro) */
+
+  int tai;			/* TAI offset (ro) */
+
+  /* ??? */
+  int  :32; int  :32; int  :32; int  :32;
+  int  :32; int  :32; int  :32; int  :32;
+  int  :32; int  :32; int  :32;
+};
 
 extern __typeof (clock_getres) __clock_getres;
 extern __typeof (clock_gettime) __clock_gettime;
diff --git a/time/Makefile b/time/Makefile
index a502c8d04f..d054bb9b7c 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -28,6 +28,8 @@ headers := time.h sys/time.h sys/timeb.h bits/time.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/struct_timeval64.h>				\
 
 routines := offtime asctime clock ctime ctime_r difftime \
 	    gmtime localtime mktime time		 \