]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Y2038: add function __ntp_gettime64
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Thu, 7 Sep 2017 22:42:13 +0000 (00:42 +0200)
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Wed, 24 Oct 2018 10:53:27 +0000 (12:53 +0200)
sysdeps/unix/sysv/linux/Versions
sysdeps/unix/sysv/linux/ntp_gettime.c

index 336c13b57dba727ab79691bb7844f7ceb291424c..07a36e87db5fdad0d4b158b581b5016dcacdb194 100644 (file)
@@ -170,6 +170,7 @@ libc {
     memfd_create;
     mlock2;
     pkey_alloc; pkey_free; pkey_set; pkey_get; pkey_mprotect;
+    __ntp_gettime64;
   }
   GLIBC_PRIVATE {
     # functions used in other libraries
index 18650da94cea3d8234af47fe6eb73304bee50924..f025263fab7184289fbbc9e4a73959e549bdbc05 100644 (file)
@@ -18,6 +18,7 @@
 #define ntp_gettime ntp_gettime_redirect
 
 #include <sys/timex.h>
+#include <include/time.h>
 
 #undef ntp_gettime
 
@@ -39,3 +40,20 @@ ntp_gettime (struct ntptimeval *ntv)
   ntv->esterror = tntx.esterror;
   return result;
 }
+
+/* The 64-bit-time version */
+
+int
+__ntp_gettime64 (struct __ntptimeval64 *ntv)
+{
+  struct timex tntx;
+  int result;
+
+  tntx.modes = 0;
+  result = __adjtimex (&tntx);
+  ntv->time.tv_sec = tntx.time.tv_sec;
+  ntv->time.tv_usec = tntx.time.tv_usec;
+  ntv->maxerror = tntx.maxerror;
+  ntv->esterror = tntx.esterror;
+  return result;
+}