Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ rustc-std-workspace-alloc = { version = "1.0.0", optional = true } # not aliased
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
linux-raw-sys = { version = "0.11.0", default-features = false, features = ["auxvec", "general", "errno", "ioctl", "no_std", "elf"] }
libc_errno = { package = "errno", version = "0.3.10", default-features = false, optional = true }
libc = { version = "0.2.177", default-features = false, optional = true }
libc = { version = "0.2.181", default-features = false, optional = true }

# Dependencies for platforms where only libc is supported:
#
# On all other Unix-family platforms, and under Miri, we always use the libc
# backend, so enable its dependencies unconditionally.
[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
libc_errno = { package = "errno", version = "0.3.10", default-features = false }
libc = { version = "0.2.177", default-features = false }
libc = { version = "0.2.181", default-features = false }

# Additional dependencies for Linux and Android with the libc backend:
#
Expand Down
24 changes: 2 additions & 22 deletions src/backend/libc/fs/makedev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::fs::Dev;
target_os = "aix",
target_os = "android",
target_os = "emscripten",
target_os = "redox",
)))]
#[inline]
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
Expand Down Expand Up @@ -45,17 +44,6 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
| (u64::from(min) & 0x0000_00ff_u64)
}

#[cfg(target_os = "redox")]
#[inline]
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
// Redox's makedev is reportedly similar to 32-bit Android's but the return
// type is signed.
((i64::from(maj) & 0xffff_f000_i64) << 32)
| ((i64::from(maj) & 0x0000_0fff_i64) << 8)
| ((i64::from(min) & 0xffff_ff00_i64) << 12)
| (i64::from(min) & 0x0000_00ff_i64)
}

#[cfg(target_os = "emscripten")]
#[inline]
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
Expand Down Expand Up @@ -83,7 +71,6 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
target_os = "android",
target_os = "emscripten",
target_os = "netbsd",
target_os = "redox"
)))]
#[inline]
pub(crate) fn major(dev: Dev) -> u32 {
Expand All @@ -102,10 +89,7 @@ pub(crate) fn major(dev: Dev) -> u32 {
(unsafe { c::major(dev) }) as u32
}

#[cfg(any(
all(target_os = "android", target_pointer_width = "32"),
target_os = "redox"
))]
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
#[inline]
pub(crate) fn major(dev: Dev) -> u32 {
// 32-bit Android's `dev_t` is 32-bit, but its `st_dev` is 64-bit, so we do
Expand All @@ -126,7 +110,6 @@ pub(crate) fn major(dev: Dev) -> u32 {
target_os = "android",
target_os = "emscripten",
target_os = "netbsd",
target_os = "redox",
)))]
#[inline]
pub(crate) fn minor(dev: Dev) -> u32 {
Expand All @@ -145,10 +128,7 @@ pub(crate) fn minor(dev: Dev) -> u32 {
(unsafe { c::minor(dev) }) as u32
}

#[cfg(any(
all(target_os = "android", target_pointer_width = "32"),
target_os = "redox"
))]
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
#[inline]
pub(crate) fn minor(dev: Dev) -> u32 {
// 32-bit Android's `dev_t` is 32-bit, but its `st_dev` is 64-bit, so we do
Expand Down
Loading