Expand description
A (probably only Linux-compatible) crate that provides ClockSyncer
, which can synchronize
on-demand the system-wide real-time (i.e., wall-clock time) clock using a specified PTP clock
as the source of truth.
It was originally developed to be used with KVM’s paravirtualized PTP clock as source.
Structs§
- Clock
Syncer - Stores the state of the source PTP clock (i.e., an open file descriptor to it),
and provides
ClockSyncer::sync
to set on-demand the system-wide real-time (i.e., wall-clock time) clock to the time of that source PTP clock.
Enums§
Constants§
- PTP_
CLOCK_ NAME_ LEN - The maximum length of a PTP clock’s name in bytes, based on Linux source code, which
equals to
32
bytes.
Functions§
- find_
ptp_ kvm - Attempt to find the path to a device node (under
/dev/
) that corresponds to the KVM PTP clock. - procfs_
find_ ptp_ major - Search
procfs(5)
for the major number assigned to the PTP driver. - verify_
ptp_ dev - Returns
true
if the provided (absolute)path
refers to a PTP clock device node (typically under/dev/
), orfalse
otherwise.