Build broken on NetBSD and FreeBSD

Eric S. Raymond esr at
Sun Oct 16 11:08:58 UTC 2016

Hal Murray <hmurray at>:
> ../../libntp/machines.c:92:5: error: 'struct timex' has no member named 'time'
> ../../libntp/machines.c:101:5: error: 'struct timex' has no member named 
> 'time'

Fixed, I think.  I don't have a *BSD test system.  Sorry about the
belated response, my meatspace life has been sistracting this week.

And now I think I fully understand the ntpd system-call interface,
finally.  Your bug report caused the last piece to fall into place.
Here's the explanation for the record.

Under Linux, adjtimex(2) can be and is used to implement both ntp_adjtime()
and BSD-style adjtime(). The former is done directly through struct timex
members by defining ADJ_* mode masks to be identical to the corresponding,
more portable, MOD_* mode masks.  The latter is done with the 'time' member
(which don't exist in the *BSD versions of struct timex) and the ADJ_SETOFFSET
mode mask.

But in ntpd, the ntp_adjtime() calls never touch the time member.  The
minor mistake I made in introducing ntp_adjtime_ns() was to try to
scale the Linux-specific time member as though it exists portably and
ntpd uses it.  Neither is the case.  When ntpd needs to bump time (as
opposed to changing the tick rate to slew it) it calls adjtime(2),
which may call adjtimex() under the covers.

You are lost in a maze of twisty, poorly-documented system calls, all different.
		<a href="">Eric S. Raymond</a>

More information about the devel mailing list