summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/ntp_gettimex.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/ntp_gettimex.c')
-rw-r--r--sysdeps/unix/sysv/linux/ntp_gettimex.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/ntp_gettimex.c b/sysdeps/unix/sysv/linux/ntp_gettimex.c
index e491549765..abd1c7ed5a 100644
--- a/sysdeps/unix/sysv/linux/ntp_gettimex.c
+++ b/sysdeps/unix/sysv/linux/ntp_gettimex.c
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <sys/timex.h>
+#include <include/time.h>
#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;
+}