| Re: [chrony-dev] clock_gettime() support |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] clock_gettime() support
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Wed, 28 Jan 2026 11:11:44 +1300
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m37lf0.a1-4.dyn; x=1769552823; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:To:Date:Subject:From:Reply-To:Sender: List-Unsubscribe:List-Unsubscribe-Post; bh=Ag0ErTKX8Z8dlG1d3GqWB4P8qkrllTT/hlpg4hHFoZ0=; b=I2q7uTAE6CFm5d42IZ7CzJaVy5 zhsgdn2kJMniBrWBL/6G9Mx0XHJ/Om+UEhbaMPdrDKxa5JwbExi5NuamcDMMqUE07bU+vDnbKUzKt HgOHRfjB3JFNh9GAc8We0BQ0WWTj/Qq+l7nGQp8Xtsf9GjEHRUJm53i3bnA2kCbPGB1ltAtbBz/ND dp/nGY+qB00811v4FofOBAemXbZR9eaNaATiQCfi24+/cFbWUNqOdGn8aHSjRaV0WLI0qgNkOlaM3 6LRJeJXu8EtWpGSTQvavRSCJqRL0cP9MsJn+3BWzAbrwe1YcYkR3votdy9lwo0lZzjBuf1myc9VAi zq3BSJpw==;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whatroute.net; i=@whatroute.net; q=dns/txt; s=s149811; t=1769551923; h=from : subject : to : message-id : date; bh=Ag0ErTKX8Z8dlG1d3GqWB4P8qkrllTT/hlpg4hHFoZ0=; b=M1dvYRSbQql6rfrF2zvFPTZ/7heqRD7qR7AUCoQLEkrNhqLseYucckUn7QWOAPpfVHDbb qTQ3INudSGaIxm4hyh6ndnNmfIVBlRa2qz3jMPtmgi5Dqf/c7On38dD5APfrhqsH6ptYHDf SIWePpFzF/u1jTGIdkCylqdko5QehAOREvbz7hqhWwfYoNPiaRmTJLxmlE+xoi9PbsoZB7v U6thglD/0pBqaF7swEsUz/XWo6bO5ZXfJ3i4rclK6XtLIoRDxael5Uu1MA56dUsIP9brOKz EvsqxyrMTk7u5AeEUA6w8nbzRf07BabYlqbPX8aYsWVgDvBxloHrVQU04SrQ==
- Feedback-id: 149811m:149811acx33YQ:149811sP1zuWj72-
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 <mlichvar@xxxxxxxxxx> 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 chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
> For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
> Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.
>
Bryan Christianson
bryan@xxxxxxxxxxxxx
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.