Skip to content

Commit 8bf15a0

Browse files
authored
Drop custom makedev implementation for Redox (#1582)
* Drop custom makedev implementation for Redox * Bump libc to 0.2.181
1 parent 74b886d commit 8bf15a0

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ rustc-std-workspace-alloc = { version = "1.0.0", optional = true } # not aliased
3535
[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]
3636
linux-raw-sys = { version = "0.11.0", default-features = false, features = ["auxvec", "general", "errno", "ioctl", "no_std", "elf"] }
3737
libc_errno = { package = "errno", version = "0.3.10", default-features = false, optional = true }
38-
libc = { version = "0.2.177", default-features = false, optional = true }
38+
libc = { version = "0.2.181", default-features = false, optional = true }
3939

4040
# Dependencies for platforms where only libc is supported:
4141
#
4242
# On all other Unix-family platforms, and under Miri, we always use the libc
4343
# backend, so enable its dependencies unconditionally.
4444
[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]
4545
libc_errno = { package = "errno", version = "0.3.10", default-features = false }
46-
libc = { version = "0.2.177", default-features = false }
46+
libc = { version = "0.2.181", default-features = false }
4747

4848
# Additional dependencies for Linux and Android with the libc backend:
4949
#

src/backend/libc/fs/makedev.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use crate::fs::Dev;
1414
target_os = "aix",
1515
target_os = "android",
1616
target_os = "emscripten",
17-
target_os = "redox",
1817
)))]
1918
#[inline]
2019
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
@@ -45,17 +44,6 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
4544
| (u64::from(min) & 0x0000_00ff_u64)
4645
}
4746

48-
#[cfg(target_os = "redox")]
49-
#[inline]
50-
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
51-
// Redox's makedev is reportedly similar to 32-bit Android's but the return
52-
// type is signed.
53-
((i64::from(maj) & 0xffff_f000_i64) << 32)
54-
| ((i64::from(maj) & 0x0000_0fff_i64) << 8)
55-
| ((i64::from(min) & 0xffff_ff00_i64) << 12)
56-
| (i64::from(min) & 0x0000_00ff_i64)
57-
}
58-
5947
#[cfg(target_os = "emscripten")]
6048
#[inline]
6149
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
@@ -83,7 +71,6 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
8371
target_os = "android",
8472
target_os = "emscripten",
8573
target_os = "netbsd",
86-
target_os = "redox"
8774
)))]
8875
#[inline]
8976
pub(crate) fn major(dev: Dev) -> u32 {
@@ -102,10 +89,7 @@ pub(crate) fn major(dev: Dev) -> u32 {
10289
(unsafe { c::major(dev) }) as u32
10390
}
10491

105-
#[cfg(any(
106-
all(target_os = "android", target_pointer_width = "32"),
107-
target_os = "redox"
108-
))]
92+
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
10993
#[inline]
11094
pub(crate) fn major(dev: Dev) -> u32 {
11195
// 32-bit Android's `dev_t` is 32-bit, but its `st_dev` is 64-bit, so we do
@@ -126,7 +110,6 @@ pub(crate) fn major(dev: Dev) -> u32 {
126110
target_os = "android",
127111
target_os = "emscripten",
128112
target_os = "netbsd",
129-
target_os = "redox",
130113
)))]
131114
#[inline]
132115
pub(crate) fn minor(dev: Dev) -> u32 {
@@ -145,10 +128,7 @@ pub(crate) fn minor(dev: Dev) -> u32 {
145128
(unsafe { c::minor(dev) }) as u32
146129
}
147130

148-
#[cfg(any(
149-
all(target_os = "android", target_pointer_width = "32"),
150-
target_os = "redox"
151-
))]
131+
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
152132
#[inline]
153133
pub(crate) fn minor(dev: Dev) -> u32 {
154134
// 32-bit Android's `dev_t` is 32-bit, but its `st_dev` is 64-bit, so we do

0 commit comments

Comments
 (0)