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: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Wed, 12 Jul 2017 22:08:54 +1200
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a1707; h=Feedback-ID:X-Smtpcorp-Track:Message-Id:To:Date: Subject:From:Reply-To:Sender:List-Unsubscribe; bh=tdnSU1ByFvW7rWhhAJhi98eZ5K/0hFtZZjeX/pZE3AI=; b=hOgUEB7BabXCEfGoUWv6uGg4wY iqLvgtC3e3KNBim0mWTwYCFb//PrTR2JDW6mckWU8mMHTpWH0knteGAKWMR8BnVGKx1lsLaSz7pmH elrzk2PDPAy+yk6ZDro1fsfKbsnrF1r/lwGGVnkMM8+eqbfLYc590jVDjHyGka+l32vx/K6fnksoj /gbt1mwJLpN1VPtfgkMXy5CutTsznV7+LleExuStMFltXkOa2AE+5z+0dsotJ4IcTryb2UxYafxKt xKQGpvCf2u3rALl3t/zigCLd1bgBWeBk8n/jdtT2UR3qqcDWI3dqLAlld+jR2LEd+5UTDTjqOAamx UoD8xAxg==;
- Feedback-id: 149811m:149811acx33YQ:149811s5SKt4R3ei:SMTPCORP
> On 12/07/2017, at 9:55 PM, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
>
> 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.
Thanks Miroslav. I like the test_adjtime() way.
If/when Apple fix the bug its simple to remove but doesn't require users to upgrade to a new version of chrony to get the benefit of a fixed kernel.
And failing that, then as you say, another #ifdef
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.