diff options
author | Steve Lau <stevelauc@outlook.com> | 2022-10-02 16:14:23 +0800 |
---|---|---|
committer | Steve Lau <stevelauc@outlook.com> | 2022-10-02 16:14:23 +0800 |
commit | 11a1ffe2246cdcb029a1d7f6f1e96a869ef9e336 (patch) | |
tree | 72b51f5c10cc63c42baff9664f880943f680f2db /src | |
parent | d99a59db0c27fee88dc2be97f5df171e94faec29 (diff) | |
download | rust-libc-11a1ffe2246cdcb029a1d7f6f1e96a869ef9e336.tar.gz |
add major/minor/makedev on apple OSes
Diffstat (limited to 'src')
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 12 |
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! { |