about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/include
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2020-04-22 01:01:21 +0200
committerLukasz Majewski <lukma@denx.de>2020-05-20 01:03:27 +0200
commitdf4289508a3a0e345a87544ee4eea8cbb4c9d197 (patch)
tree8107392e5446ea9b5080ecbebd87633eacb7be6b /sysdeps/unix/sysv/linux/include
parent0308077e3a4ff1c123cdddd311f55a2ecdd3115c (diff)
downloadglibc-df4289508a3a0e345a87544ee4eea8cbb4c9d197.tar.gz
glibc-df4289508a3a0e345a87544ee4eea8cbb4c9d197.tar.xz
glibc-df4289508a3a0e345a87544ee4eea8cbb4c9d197.zip
y2038: Introduce struct __ntptimeval64 - new internal glibc type
This type is a glibc's "internal" type to get time parameters data from
Linux kernel (NTP daemon interface). It stores time in struct __timeval64
rather than struct timeval, which makes it Y2038-proof.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/include')
-rw-r--r--sysdeps/unix/sysv/linux/include/sys/timex.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h
index cf3059f63c..8c536b9a95 100644
--- a/sysdeps/unix/sysv/linux/include/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/include/sys/timex.h
@@ -32,6 +32,7 @@ libc_hidden_proto (__adjtimex)
 #   define __timex64 timex
 #   define __clock_adjtime64 __clock_adjtime
 #   define ___adjtimex64 ___adjtimex
+#   define __ntptimeval64 ntptimeval
 #  else
 
 struct __timex64
@@ -77,6 +78,19 @@ extern int __clock_adjtime64 (const clockid_t clock_id, struct __timex64 *tx64);
 libc_hidden_proto (__clock_adjtime64);
 extern int ___adjtimex64 (struct __timex64 *tx64);
 libc_hidden_proto (___adjtimex64)
+
+struct __ntptimeval64
+{
+  struct __timeval64 time;	/* current time (ro) */
+  long int maxerror;	/* maximum error (us) (ro) */
+  long int esterror;	/* estimated error (us) (ro) */
+  long int tai;		/* TAI offset (ro) */
+
+  long int __glibc_reserved1;
+  long int __glibc_reserved2;
+  long int __glibc_reserved3;
+  long int __glibc_reserved4;
+};
 #  endif
 
 /* Convert a known valid struct timex into a struct __timex64.  */