[ntp:bugs] [Bug 769] ntp's adjtime checks only work with glibc on linux
A Bugzilla User via the NTP Bugzilla
bugzilla at ntp.isc.org
Sun Mar 18 12:57:59 PST 2007
http://bugs.ntp.isc.org/769
----------------------------------------------------------------------------
Additional Comments From kurt at roeckx.be ()
Submitted on 2007-03-18 20:57
It seems there is alot of confusion about this.
On a libc5 (glibc1) system, the sys/timex.h has:
extern int __adjtimex __P ((struct timex * __ntx));
extern int __ntp_gettime __P ((struct ntptimeval * __ntv));
The library (libc.so.5) provides the following symbols:
__adjtimex
__libc_adjtimex
adjtimex
__ntp_gettime
where adjtimex and __adjtimex are weak alias for __libc_adjtimex
On a (current) glibc2, the sys/timex.h has:
extern int __adjtimex (struct timex *__ntx) __THROW;
extern int adjtimex (struct timex *__ntx) __THROW;
extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
extern int ntp_adjtime (struct timex *__tntx) __THROW;
The library has the following symbols:
__adjtimex
adjtimex
ntp_gettime
ntp_adjtime
where ntp_adjtime and adjtimex are weak aliases for __adjtimex
So, in case of libc5, for adjusting the time, you either use adjtimex or
__adjtimex. Both should work. To get the time, you use __ntp_gettime.
For a glibc2 system, you could just use the ntp_gettime and ntp_adjtime
functions, or if you really want you could also use adjtimex or __adjtimex.
I suggest you try finding the symbols, and use the first one you can find.
Anyway, if you're linked to libc5 (libc.so.5), an "upgrade" to a glibc2 library
doesn't change anything. ntpd will still use the libc.so.5 file. It need to be
relinked to start using glibc2. On architectures that used libc5, glibc2 is
ussually called libc.so.6 (or libc6 in short). It's a differnet "soname", and
when linking it stores the soname.
I hope this clears things up.
Kurt
--
<kurt at roeckx.be>
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the bugs
mailing list