<sys/timex.h> and NTP incompatibility (MOD_NANO)

From: Ulrich Windl
Date: Mon Feb 01 2016 - 02:38:18 EST


Hi folks!

I'd wish ntp_loopfilter.c would compile without problems. The mess is (I had fixed it about 15 years ago (keyword "PPSkit")) that Linux uses ADJ_* flags to do traditional adjtime() things, as well as NTP kernel-related things (That's why the Linux syscall is named adjtimex()).
NTP however expects the flags to have names like MOD_* to modify settings, and STA_* for status bits to test.

When <sys/timex.h>lacks a MOD_NANO, but has a STA_NANO, compilation of ntpd/ntp_loopfilter.c fails.

I'd wish this to be fixed. I don't know which "Bonehead weakener" is needed to get the fix permanently into Linux.

My proposal many years ago was to use ADJ_* style flags only for the Linux specialities (the adjtime() part of adjtimex()), and use the MOD_* style flags for the NTP part of adjtimex().

Regards,
Ulrich
---
Appendix: Linux has only these:
/* xntp 3.4 compatibility names */
#define MOD_OFFSET ADJ_OFFSET
#define MOD_FREQUENCY ADJ_FREQUENCY
#define MOD_MAXERROR ADJ_MAXERROR
#define MOD_ESTERROR ADJ_ESTERROR
#define MOD_STATUS ADJ_STATUS
#define MOD_TIMECONST ADJ_TIMECONST
#define MOD_CLKB ADJ_TICK
#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */