Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/viona-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ impl VionaFd {
}

/// Retrieve the minor number of the viona device instance.
/// This is used for matching kernal statistic entries to the viona device.
/// This is used for matching kernel statistic entries to the viona device.
pub fn instance_id(&self) -> Result<u32> {
let meta = self.0.metadata()?;
let rdev = meta.rdev();
#[cfg(not(target_os = "macos"))]
let minor = unsafe { libc::minor(rdev) };
#[cfg(target_os = "macos")]
let minor = unsafe { libc::minor(rdev as libc::dev_t) as u32 };
Ok(minor)
}

Expand Down
Loading