/* ================================================== */
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);
}
}
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
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);
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)
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:
/* ================================================== */
static void
-set_leap(int leap)
+set_leap(int leap, int tai_offset)
{
struct timex txc;
int applied;