NTP and uClibc

Michael Deutschmann michael at talamasca.ocis.net
Thu Dec 4 22:52:33 UTC 2008


One of the new configure options in uClibc-0.9.30, UCLIBC_NTP_LEGACY,
controls the ntp_gettime() and ntp_adjtime() calls, which are only used by
the NTP daemon.

You should be aware that stock ntp-4.2.4p5, the current version, will in
fact not compile on uClibc no matter how that flag is set.


The problem is that ntp requires the call "__adjtimex".  If __adjtimex is
not detected, the "tickadj" utility will fail to build on Linux.  (It
falls back to a hack it uses on non-Linux kernels, and uClibc doesn't
supply the headers it would need for that.)

uClibc has "adjtimex", which has identical semantics (so far as I know),
but NTP and its configure script won't use that.  The two underscores are
mandatory.  So to get ntpd to work on uClibc, I have to supply a shim
library that translates __adjtimex() to adjtimex().

The good news is that if __adjtimex() is available, NTP can be fully
functional without the ntp_???time() calls.


So, in the next version of uClibc, I recommend changing "adjtimex" to
"__adjtimex", and removing the ntp_???time calls entirely.

---- Michael Deutschmann <michael at talamasca.ocis.net>



More information about the uClibc mailing list