aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/sys
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-11-22 11:07:04 -0800
committerUlrich Drepper <drepper@redhat.com>2009-11-22 11:07:04 -0800
commiteb4157390cac6212921ef198353635e138dc0a00 (patch)
treee0f2fd59ab88aa6e36db17432e705c8b3c6a3a51 /sysdeps/unix/sysv/linux/sys
parent89b432d7a5befb85048c97e881b2106e8df58e43 (diff)
downloadglibc-eb4157390cac6212921ef198353635e138dc0a00.tar
glibc-eb4157390cac6212921ef198353635e138dc0a00.tar.gz
glibc-eb4157390cac6212921ef198353635e138dc0a00.tar.bz2
glibc-eb4157390cac6212921ef198353635e138dc0a00.zip
Update ntp_gettime for Linux.
The ntp_gettime implementation of NTP exports the tai field the kernel now produces. This requires an ABI change since the ntptimeval structure changed. Upstream kept the same name, there is nothing to do. This patch changes the ntptimeval structure but keeps the old ntp_gettime definition. A new ntp_gettimex function which is transparently invoked through the old name is introduced. This has the advantage that even object files can remain compatible. This wouldn't be the case if symbol versioning would be used to overload the name ntp_gettime.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sys')
-rw-r--r--sysdeps/unix/sysv/linux/sys/timex.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h
index 88b87f1089..e10311f70f 100644
--- a/sysdeps/unix/sysv/linux/sys/timex.h
+++ b/sysdeps/unix/sysv/linux/sys/timex.h
@@ -24,11 +24,19 @@
/* These definitions from linux/timex.h as of 2.6.30. */
+#define NTP_API 4 /* NTP API version */
+
struct ntptimeval
{
struct timeval 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 __unused1;
+ long int __unused2;
+ long int __unused3;
+ long int __unused4;
};
struct timex
@@ -132,7 +140,13 @@ __BEGIN_DECLS
extern int __adjtimex (struct timex *__ntx) __THROW;
extern int adjtimex (struct timex *__ntx) __THROW;
-extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
+#if defined __GNUC__ && __GNUC__ >= 2
+extern int ntp_gettime (struct ntptimeval *__ntv)
+ __asm__ ("ntp_gettimex") __THROW;
+#else
+extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
+# define ntp_gettime ntp_gettimex
+#endif
extern int ntp_adjtime (struct timex *__tntx) __THROW;
__END_DECLS