/rust/registry/src/index.crates.io-1949cf8c6b5b557f/rustix-1.1.3/src/fs/makedev.rs
Line | Count | Source |
1 | | use crate::backend; |
2 | | use crate::fs::Dev; |
3 | | |
4 | | /// `makedev(maj, min)`—Compute a device ID from a given major and minor ID. |
5 | | /// |
6 | | /// # References |
7 | | /// - [Linux] |
8 | | /// |
9 | | /// [Linux]: https://man7.org/linux/man-pages/man3/makedev.3.html |
10 | | #[inline] |
11 | 0 | pub fn makedev(maj: u32, min: u32) -> Dev { |
12 | 0 | backend::fs::makedev::makedev(maj, min) |
13 | 0 | } |
14 | | |
15 | | /// `minor(dev)`—Compute the minor ID of a given device ID. |
16 | | /// |
17 | | /// # References |
18 | | /// - [Linux] |
19 | | /// |
20 | | /// [Linux]: https://man7.org/linux/man-pages/man3/minor.3.html |
21 | | #[inline] |
22 | 0 | pub fn minor(dev: Dev) -> u32 { |
23 | 0 | backend::fs::makedev::minor(dev) |
24 | 0 | } |
25 | | |
26 | | /// `major(dev)`—Compute the major ID of a given device ID. |
27 | | /// |
28 | | /// # References |
29 | | /// - [Linux] |
30 | | /// |
31 | | /// [Linux]: https://man7.org/linux/man-pages/man3/major.3.html |
32 | | #[inline] |
33 | 0 | pub fn major(dev: Dev) -> u32 { |
34 | 0 | backend::fs::makedev::major(dev) |
35 | 0 | } |