summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/libc/fs/makedev.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/backend/libc/fs/makedev.rs')
-rw-r--r--vendor/rustix/src/backend/libc/fs/makedev.rs32
1 files changed, 25 insertions, 7 deletions
diff --git a/vendor/rustix/src/backend/libc/fs/makedev.rs b/vendor/rustix/src/backend/libc/fs/makedev.rs
index afe942a59..640d5005b 100644
--- a/vendor/rustix/src/backend/libc/fs/makedev.rs
+++ b/vendor/rustix/src/backend/libc/fs/makedev.rs
@@ -1,9 +1,10 @@
#[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
-use super::super::c;
+use crate::backend::c;
use crate::fs::Dev;
#[cfg(not(any(
apple,
+ solarish,
target_os = "aix",
target_os = "android",
target_os = "emscripten",
@@ -13,6 +14,13 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
c::makedev(maj, min)
}
+#[cfg(solarish)]
+pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
+ // SAFETY: Solarish's `makedev` is marked unsafe but it isn't doing
+ // anything unsafe.
+ unsafe { c::makedev(maj, min) }
+}
+
#[cfg(all(target_os = "android", not(target_pointer_width = "32")))]
#[inline]
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
@@ -54,19 +62,24 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
#[cfg(not(any(
apple,
freebsdlike,
- netbsdlike,
target_os = "android",
target_os = "emscripten",
+ target_os = "netbsd"
)))]
#[inline]
pub(crate) fn major(dev: Dev) -> u32 {
unsafe { c::major(dev) }
}
-#[cfg(all(target_os = "android", not(target_pointer_width = "32")))]
+#[cfg(any(
+ apple,
+ freebsdlike,
+ target_os = "netbsd",
+ all(target_os = "android", not(target_pointer_width = "32")),
+))]
#[inline]
pub(crate) fn major(dev: Dev) -> u32 {
- // Android's `major` oddly has signed return types.
+ // On some platforms `major` oddly has signed return types.
(unsafe { c::major(dev) }) as u32
}
@@ -88,19 +101,24 @@ pub(crate) fn major(dev: Dev) -> u32 {
#[cfg(not(any(
apple,
freebsdlike,
- netbsdlike,
target_os = "android",
target_os = "emscripten",
+ target_os = "netbsd"
)))]
#[inline]
pub(crate) fn minor(dev: Dev) -> u32 {
unsafe { c::minor(dev) }
}
-#[cfg(all(target_os = "android", not(target_pointer_width = "32")))]
+#[cfg(any(
+ apple,
+ freebsdlike,
+ target_os = "netbsd",
+ all(target_os = "android", not(target_pointer_width = "32"))
+))]
#[inline]
pub(crate) fn minor(dev: Dev) -> u32 {
- // Android's `minor` oddly has signed return types.
+ // On some platforms, `minor` oddly has signed return types.
(unsafe { c::minor(dev) }) as u32
}