Re: [chrony-dev] [PATCH] macOS - support for ntp_adjtime() |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH] macOS - support for ntp_adjtime()
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 12 Jul 2017 11:55:44 +0200
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C8A634E4D6
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C8A634E4D6
On Wed, Jul 12, 2017 at 05:56:36PM +1200, Bryan Christianson wrote:
> > On 11/07/2017, at 7:26 PM, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
> > I agree, as long as they can fix the adjtime() bug. If it's not fixed,
> > it would probably be better to disable the fast-slewing feature in
> > order to avoid adjtime().
>
> I'm not sure how to do this. Any hints?
> I'm assuming Apple will get around to fixing the bug so I figured we don't want to add anything code will be difficult to remove at a later date.
The initialization function could look like this:
have_ntp_adjtime = (dlsym(RTLD_NEXT, "ntp_adjtime") != NULL);
if (have_ntp_adjtime) {
buggy_adjtime = !test_adjtime();
if (buggy_adjtime)
SYS_Timex_Initialise();
else
SYS_NetBSD_Initialise();
return;
}
test_adjtime() would check tv after calling adjtime({-1, 999999},
NULL) and adjtime({0,0}, &tv), or something that doesn't slew the
clock too much. If that's not possible, the function could be selected
with an #ifdef BUGGY_ADJTIME and the macro would be defined until we
know it's fixed.
--
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.