[chrony-dev] [PATCH v2 1/2] reference: add function to get current tai offset

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


---
 reference.c | 10 ++++++++++
 reference.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/reference.c b/reference.c
index 8138b8c..556106e 100644
--- a/reference.c
+++ b/reference.c
@@ -1355,6 +1355,16 @@ int REF_IsLeapSecondClose(void)
 }
 
 /* ================================================== */
+int
+REF_GetTaiOffset(struct timespec *ts)
+{
+  int tai_offset;
+
+  get_tz_leap(ts->tv_sec, &tai_offset);
+  return tai_offset;
+}
+
+/* ================================================== */
 
 void
 REF_GetTrackingReport(RPT_TrackingReport *rep)
diff --git a/reference.h b/reference.h
index e376770..84f0b8e 100644
--- a/reference.h
+++ b/reference.h
@@ -184,6 +184,9 @@ extern void REF_DisableLocal(void);
    and is better to discard any measurements */
 extern int REF_IsLeapSecondClose(void);
 
+/* Return the current TAI - UTC offset calculated from timezone files */
+extern int REF_GetTaiOffset(struct timespec *ts);
+
 extern void REF_GetTrackingReport(RPT_TrackingReport *rep);
 
 #endif /* GOT_REFERENCE_H */
-- 
2.13.5


-- 
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.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/