mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
util: add function to subtract NTP timestamps
This will be needed to work with monotonic timestamps, which don't have a stable epoch and cannot be converted to timespec.
This commit is contained in:
3
util.h
3
util.h
@@ -155,6 +155,9 @@ extern void UTI_TimespecToNtp64(const struct timespec *src, NTP_int64 *dest,
|
||||
/* Convert an NTP timestamp into a timespec */
|
||||
extern void UTI_Ntp64ToTimespec(const NTP_int64 *src, struct timespec *dest);
|
||||
|
||||
/* Calculate a - b in any epoch */
|
||||
extern double UTI_DiffNtp64ToDouble(const NTP_int64 *a, const NTP_int64 *b);
|
||||
|
||||
/* Check if time + offset is sane */
|
||||
extern int UTI_IsTimeOffsetSane(const struct timespec *ts, double offset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user