The macOS driver overrides clock_gettime() and falls back to gettimeofday() if 
the clock_gettime() symbol is not present. This override function can be easily 
removed.

The driver also checks to see if ntp_adtime() is present and then invokes the 
netBSD driver if it is. I think the old code in the macOS driver that uses 
adjtime() should also be removed, but maybe in a separate patch. As far as I 
can tell, Apple implemented ntp_adjtime() around the same time frame as 
clock_gettime() so there will be very few instances of the old code actually 
being used. 

> On 28 Jan 2026, at 04:02, Miroslav Lichvar <[email protected]> wrote:
> 
> Is it ok to assume all systems supported by chrony now provide the
> standard clock_gettime(), working at least with CLOCK_REALTIME and
> CLOCK_MONOTONIC?
> 
> There is a comment in the macOS driver that it's available only on
> macOS 10.12 and later. Wikipedia says 10.11.6 was released on July 9,
> 2018.
> 
> I'm considering some changes in order to support synchronization of
> Linux PHC and CLOCK_AUX clocks and it would simplify things if I could
> just drop the gettimeofday() support and use the CLOCK_* identifiers
> everywhere.
> 
> -- 
> Miroslav Lichvar
> 
> 
> -- 
> To unsubscribe email [email protected] with 
> "unsubscribe" in the subject.
> For help email [email protected] with "help" in the 
> subject.
> Trouble?  Email [email protected].
> 

Bryan Christianson
[email protected]




--
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].

Reply via email to