Skip to content

Commit

Permalink
add major/minor/makedev on apple OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC committed Oct 2, 2022
1 parent d99a59d commit 11a1ffe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down

0 comments on commit 11a1ffe

Please sign in to comment.