diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index d17d5e0050558..cee87ffbfc490 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -4976,6 +4976,18 @@ f! { pub {const} fn VM_MAKE_TAG(id: u8) -> u32 { (id as u32) << 24u32 } + + pub fn major(dev: dev_t) -> i32 { + (dev >> 24) & 0xff + } + + pub fn minor(dev: dev_t) -> i32 { + dev & 0xffffff + } + + pub fn makedev(major: i32, minor: i32) -> dev_t { + (major << 24) | minor + } } safe_f! {