| [chrony-dev] [RFC PATCH v1 06/17] local: Use auxiliary clock in local.c |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] [RFC PATCH v1 06/17] local: Use auxiliary clock in local.c
- From: Christopher S M Hall <christopher.s.hall@xxxxxxxxx>
- Date: Sat, 6 Dec 2025 06:10:52 +0000
- Cc: christopher.s.hall@xxxxxxxxx, david.zage@xxxxxxxxx, yoong.siang.song@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765002154; x=1796538154; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LQoKZ6aV/OtLLt3+H9akby2983LKrN3qPabbNBknRnM=; b=j/pbIUwfo6dWzE7BHoD/ZUpF9lQSb/nK1Bpqh+wyQmm43Nr80x95jKQp L6tFhjnW9zDPnsPKw/l0HE5cf0TGVnqHJPqHkvRAtF2kj7WICzOGN0FB9 VT/NuLB28Bc6Gfp72BjGevfo3btbaxCEDNtF3mjzZjtG71GvwcwFhZ4Q8 FmlRkxUf/yHr2LGADr8jsTm9fm1ccsCmT6Mm3CIbQEE7OpMKbHmXJqlsM XlVe5TVUj+GSddPwrr9uXPOqgPhyBrRCZAzDl9uPSACk7Nwxe38AbYsLs eRvMxNZv/Zl97GUQeCBZ6PEc4cdLjctp0Wx7r44nFP1XNYP0rr6vWxtzW w==;
LCL_ReadRawTime() must target the same clock being disciplined. Add additional initialization code to
read the auxiliary clock ID from the configuration.
---
local.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/local.c b/local.c
index d3725df..e6c6434 100644
--- a/local.c
+++ b/local.c
@@ -318,6 +318,15 @@ LCL_Initialise(void)
drv_accrue_offset = NULL;
drv_offset_convert = NULL;
+#if defined(FEAT_AUXCLOCK) && defined(HAVE_CLOCK_GETTIME)
+ {
+ const int *l_clockid;
+
+ l_clockid = CNF_GetAuxClockId();
+ if (l_clockid)
+ clock_id = l_clockid;
+ }
+#endif
/* This ought to be set from the system driver layer */
current_freq_ppm = 0.0;
temp_comp_ppm = 0.0;
@@ -509,6 +518,10 @@ void LCL_RemoveDispersionNotifyHandler(LCL_DispersionNotifyHandler handler, void
void
LCL_ReadRawTime(struct timespec *ts)
{
+ /* Enabling auxiliary clocks depends on HAVE_CLOCK_GETTIME
+ There is no chance that we call gettimeofday() while using
+ auxiliary clocks
+ */
#if HAVE_CLOCK_GETTIME
if (clock_gettime(*clock_id, ts) < 0)
LOG_FATAL("clock_gettime() failed : %s", strerror(errno));
--
2.34.1
--
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.