| 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: David Bohman <debohman@xxxxxxxxx>
- Date: Tue, 27 Jan 2026 18:30:20 -0800
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=N+q9MSJb+vwLLg5sZVNYhBx9TDyg2rTLiCjQDQf1gOE=; fh=uoPB0/9I8+XIRJDlhYmjz+PtjFEY7PnZixzCZd25NNE=; b=J78ezHz2MgFPH6M9Hhtme+L+fL9ihcRxL2eTXJ4xM6KiJe/NOz0TrNkOL9jFpENQFc rGWsSzCQrqwdSXHMfjUiyQT8Lxmo0aHKleJuP7Vpk6yrss94t/BT0XGrDDapFUwHkYPR I5gtvaRrI6YDn+Xr6czukAOfkz3q2/09SLzPqZWnBucswvI+DtobxrBXaMiIHogzB20Z 1MZ48h+cgZ26OddRnd1C3b9PyZjPjCotiJvudKJjZiHmgo0eMajUX091uXp5hoZAFcMk mT331AHyWKIOgmiTbb18sp40EopWFAd3uc2nCBSSeNVusMfWd6rGJ6adKD9juyhGT4EA D5Aw==; darn=chrony.tuxfamily.org
- Arc-seal: i=1; a=rsa-sha256; t=1769567432; cv=none; d=google.com; s=arc-20240605; b=BSQ+pPpHKfpKVCXx/NkjV2RSUdc819vWuo+vXTaWSWEVZp/XOp6bAEpTOCvhzq41vO sgcRpP6SQUA2i1YF74eQ7Sj4NYtJkS13N5Sil7Ure4br+Nylax/0Yv1NXE4wP0wZR/iv Sw2aHnLDKAIU4bO1xLsu3wXx4uLgyY5V3t6RayuQ66DW72pSjjyszK/iBIfqQt10+TR/ J+am1A6H1slpJSotloPJ3IOat/DnoZb4TtDPb2UhDgd+KwP4p6Bb3Jwia9M0DlaRGUOd Y1S06VxMuAsROLaZNyP1WyCRQzYoSXSk7R28BZbyiITUkLAbt/hqVUKx+KMU1EjwaRKS u5yw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769567432; x=1770172232; darn=chrony.tuxfamily.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=N+q9MSJb+vwLLg5sZVNYhBx9TDyg2rTLiCjQDQf1gOE=; b=Vzr1eM7CVsyiVnwMsk/udzdIOsGenXFta8Tqh4caFPOOZzJM4IbYB93O5FLPcKcQH0 vW7al6nX+AZAw+eHG+tzWfm0OQETioVmovkqpst5ccHIquEhmW6bJjsn5P0X5iorNrL3 d0uIzaPWK0gXUmU7qYX2+Y7xlabNmvr4rrWxOJmX3hdoJvFCcoQuoR0qSZgaxP8Zr6go 7C1vym1+blxzWecj79kqbgMQAXjV2dIxVgon1QJMOQ8Zw52LYrzVqBLI4AUpWVam/R7A m/pDskci86xJE+J9yosnlt/fXDQcRMULUAeSeLaPCZzgEI2y/1omaZgT+nUFanPYu8aK s9cA==
I still have a system that runs chrony on Sierra (10.12), so please do
not remove adjtime().
Bryan, I think you are incorrect about a synchronization between the
addition of clock_gettime() and ntp_adjtime() in Apple OSs. Sierra
implements clock_gettime() but it DOES NOT implement ntp_adjtime().
Thanks.
On Tue, Jan 27, 2026 at 2:12 PM Bryan Christianson <bryan@xxxxxxxxxxxxxx> wrote:
>
> 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.
>
--
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.