local: add support for setting TAI-UTC offset
This commit is contained in:
parent
5d838729ef
commit
a768578a26
5 changed files with 12 additions and 11 deletions
4
local.c
4
local.c
|
@ -700,10 +700,10 @@ LCL_CanSystemLeap(void)
|
|||
/* ================================================== */
|
||||
|
||||
void
|
||||
LCL_SetSystemLeap(int leap)
|
||||
LCL_SetSystemLeap(int leap, int tai_offset)
|
||||
{
|
||||
if (drv_set_leap) {
|
||||
(drv_set_leap)(leap);
|
||||
(drv_set_leap)(leap, tai_offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
9
local.h
9
local.h
|
@ -201,10 +201,11 @@ extern int LCL_MakeStep(void);
|
|||
does something */
|
||||
extern int LCL_CanSystemLeap(void);
|
||||
|
||||
/* Routine to set the system clock to correct itself for a leap second if
|
||||
supported. Leap second will be inserted at the end of the day if the
|
||||
argument is positive, deleted if negative, and zero resets the setting. */
|
||||
extern void LCL_SetSystemLeap(int leap);
|
||||
/* Routine to set the system clock to correct itself for a leap second and also
|
||||
set its TAI-UTC offset. If supported, leap second will be inserted at the
|
||||
end of the day if the argument is positive, deleted if negative, and zero
|
||||
resets the setting. */
|
||||
extern void LCL_SetSystemLeap(int leap, int tai_offset);
|
||||
|
||||
/* Routine to set a frequency correction (in ppm) that should be applied
|
||||
to local clock to compensate for temperature changes. A positive
|
||||
|
|
4
localp.h
4
localp.h
|
@ -54,8 +54,8 @@ typedef int (*lcl_ApplyStepOffsetDriver)(double offset);
|
|||
raw time to get the corrected time */
|
||||
typedef void (*lcl_OffsetCorrectionDriver)(struct timespec *raw, double *corr, double *err);
|
||||
|
||||
/* System driver to schedule leap second */
|
||||
typedef void (*lcl_SetLeapDriver)(int leap);
|
||||
/* System driver to schedule leap seconds and set TAI-UTC offset */
|
||||
typedef void (*lcl_SetLeapDriver)(int leap, int tai_offset);
|
||||
|
||||
/* System driver to set the synchronisation status */
|
||||
typedef void (*lcl_SetSyncStatusDriver)(int synchronised, double est_error, double max_error);
|
||||
|
|
|
@ -678,7 +678,7 @@ leap_end_timeout(void *arg)
|
|||
our_leap_sec = 0;
|
||||
|
||||
if (leap_mode == REF_LeapModeSystem)
|
||||
LCL_SetSystemLeap(0);
|
||||
LCL_SetSystemLeap(our_leap_sec, 0);
|
||||
|
||||
if (our_leap_status == LEAP_InsertSecond ||
|
||||
our_leap_status == LEAP_DeleteSecond)
|
||||
|
@ -778,7 +778,7 @@ update_leap_status(NTP_Leap leap, time_t now, int reset)
|
|||
|
||||
switch (leap_mode) {
|
||||
case REF_LeapModeSystem:
|
||||
LCL_SetSystemLeap(our_leap_sec);
|
||||
LCL_SetSystemLeap(our_leap_sec, 0);
|
||||
/* Fall through */
|
||||
case REF_LeapModeSlew:
|
||||
case REF_LeapModeStep:
|
||||
|
|
|
@ -95,7 +95,7 @@ set_frequency(double freq_ppm)
|
|||
/* ================================================== */
|
||||
|
||||
static void
|
||||
set_leap(int leap)
|
||||
set_leap(int leap, int tai_offset)
|
||||
{
|
||||
struct timex txc;
|
||||
int applied;
|
||||
|
|
Loading…
Reference in a new issue