Skip to content

Commit dfcd443

Browse files
authored
small change to fix builds on macos (#768)
1 parent 4ba9c33 commit dfcd443

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/viona-api/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ impl VionaFd {
6767
}
6868

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

0 commit comments

Comments
 (0)