Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small change to fix builds on macos #768

Merged
merged 1 commit into from
Sep 27, 2024
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