In trying to figure out why since upgrading to 6.5 ports/ntp was
spamming the logs with "adj_systime: Invalid argument" every 20 seconds
on some machines, I found this happened when it was calling adjtime(2)
with a small negative value in tv_usec.
The man page talks about negative deltas, but then goes on to say in the
errors section that the microsecond value must not be less than zero.
It looks like this behaviour was introduced in -r1.112, as part of a
patch to add locking around timers.
One can probably work around it by patching xntpd to use 'one second
back, 999950 microseconds forward' instead of 50 microseconds back, but
that sounds rather hacky.
Can I propose the following patch to allow negative deltas again?