From: Albert ARIBAUD (3ADEV) Date: Thu, 7 Sep 2017 22:42:14 +0000 (+0200) Subject: Y2038: add function __ntp_gettimex64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dc37789c3d11b4af53cac1f3300dd4d0fd03411;p=thirdparty%2Fglibc.git Y2038: add function __ntp_gettimex64 --- diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 07a36e87db5..955d1587d5d 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -171,6 +171,7 @@ libc { mlock2; pkey_alloc; pkey_free; pkey_set; pkey_get; pkey_mprotect; __ntp_gettime64; + __ntp_gettimex64; } GLIBC_PRIVATE { # functions used in other libraries diff --git a/sysdeps/unix/sysv/linux/ntp_gettimex.c b/sysdeps/unix/sysv/linux/ntp_gettimex.c index e4915497653..abd1c7ed5af 100644 --- a/sysdeps/unix/sysv/linux/ntp_gettimex.c +++ b/sysdeps/unix/sysv/linux/ntp_gettimex.c @@ -16,6 +16,7 @@ . */ #include +#include #ifndef MOD_OFFSET # define modes mode @@ -40,3 +41,26 @@ ntp_gettimex (struct ntptimeval *ntv) ntv->__glibc_reserved4 = 0; return result; } + +/* The 64-bit-time version */ + +int +__ntp_gettimex64 (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->maxerror = tntx.maxerror; + ntv->esterror = tntx.esterror; + ntv->tai = tntx.tai; + ntv->__glibc_reserved1 = 0; + ntv->__glibc_reserved2 = 0; + ntv->__glibc_reserved3 = 0; + ntv->__glibc_reserved4 = 0; + return result; +}