Function verify_ptp_dev

Source
pub fn verify_ptp_dev(
    dev_path: impl AsRef<Path>,
    ptp_major: Option<u32>,
) -> Result<bool, Error>
Expand description

Returns true if the provided (absolute) path refers to a PTP clock device node (typically under /dev/), or false otherwise.

By optionally providing the ptp_major, the verification is accelerated by skipping the reading and processing of procfs(5) to figure out which major number has been assigned to the PTP driver by the system.

ยงErrors

  • If the provided path is not absolute.
  • If stat(2)ing the provided path fails.
  • If procfs_find_ptp_major fails.