summaryrefslogtreecommitdiff
path: root/src/unix/bsd
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix/bsd')
-rw-r--r--src/unix/bsd/apple/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index d17d5e0050..cee87ffbfc 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! {