use std::ffi::CStr;
#[cfg(target_os = "macos")]
pub(super) fn get_bsd_name(disk: &libc::statfs) -> Option<Vec<u8>> {
unsafe {
CStr::from_ptr(disk.f_mntfromname.as_ptr())
.to_bytes_with_nul()
.strip_prefix(b"/dev/")
.map(|slice| slice.to_vec())
.or_else(|| {
sinf_debug!("unknown disk mount path format");
None
})
}
}