summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysdeps/unix/sysv/linux/Versions2
-rw-r--r--sysdeps/unix/sysv/linux/ntp_gettime.c16
-rw-r--r--sysdeps/unix/sysv/linux/ntp_gettimex.c22
-rw-r--r--sysdeps/unix/sysv/linux/sys/timex.h15
4 files changed, 53 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 3fcd1c252b..5f9a7ab08d 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -178,5 +178,7 @@ libc {
GLIBC_Y2038 {
__msgctl_t64;
+ __ntp_gettime_t64;
+ __ntp_gettimex_t64;
}
}
diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c b/sysdeps/unix/sysv/linux/ntp_gettime.c
index 915b099dc5..ffc0c60aa3 100644
--- a/sysdeps/unix/sysv/linux/ntp_gettime.c
+++ b/sysdeps/unix/sysv/linux/ntp_gettime.c
@@ -18,6 +18,7 @@
#define ntp_gettime ntp_gettime_redirect
#include <sys/timex.h>
+#include <include/time.h>
#undef ntp_gettime
@@ -39,3 +40,18 @@ ntp_gettime (struct ntptimeval *ntv)
ntv->esterror = tntx.esterror;
return result;
}
+
+int
+__ntp_gettime_t64 (struct __ntptimeval_t64 *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;
+}
diff --git a/sysdeps/unix/sysv/linux/ntp_gettimex.c b/sysdeps/unix/sysv/linux/ntp_gettimex.c
index 8ac180163d..5e3fe94396 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,24 @@ ntp_gettimex (struct ntptimeval *ntv)
ntv->__glibc_reserved4 = 0;
return result;
}
+
+int
+__ntp_gettimex_t64 (struct __ntptimeval_t64 *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;
+}
diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
index 3f1b013afd..4981d07016 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -57,13 +57,24 @@ __BEGIN_DECLS
extern int __adjtimex (struct timex *__ntx) __THROW;
extern int adjtimex (struct timex *__ntx) __THROW;
-#ifdef __REDIRECT_NTH
+#ifndef __USE_TIME_BITS64
+# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
ntp_gettimex);
-#else
+# else
extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
+# define ntp_gettime ntp_gettimex
+# endif
+#else
+# if defined(__REDIRECT)
+extern time_t __REDIRECT (ntp_gettimex, (struct ntptimeval *__ntv),
+ __ntp_gettimex_t64) __THROW;
+# else
+# define ntp_gettimex __ntp_gettimex_t64
+# endif
# define ntp_gettime ntp_gettimex
#endif
+
extern int ntp_adjtime (struct timex *__tntx) __THROW;
__END_DECLS