Skip to content

Commit 635b87b

Browse files
authored
Update libc dependency to 0.2.156. (#1065)
1 parent 2338a0d commit 635b87b

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ once_cell = { version = "1.5.2", optional = true }
3838
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), 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]
3939
linux-raw-sys = { version = "0.4.14", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
4040
libc_errno = { package = "errno", version = "0.3.8", default-features = false, optional = true }
41-
libc = { version = "0.2.153", default-features = false, optional = true }
41+
libc = { version = "0.2.156", default-features = false, optional = true }
4242

4343
# Dependencies for platforms where only libc is supported:
4444
#
4545
# On all other Unix-family platforms, and under Miri, we always use the libc
4646
# backend, so enable its dependencies unconditionally.
4747
[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), 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]
4848
libc_errno = { package = "errno", version = "0.3.8", default-features = false }
49-
libc = { version = "0.2.153", default-features = false }
49+
libc = { version = "0.2.156", default-features = false }
5050

5151
# Additional dependencies for Linux with the libc backend:
5252
#
@@ -74,7 +74,7 @@ default-features = false
7474

7575
[dev-dependencies]
7676
tempfile = "3.5.0"
77-
libc = "0.2.153"
77+
libc = "0.2.156"
7878
libc_errno = { package = "errno", version = "0.3.8", default-features = false }
7979
serial_test = "2.0.0"
8080
memoffset = "0.9.0"

src/backend/libc/param/auxv.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ pub(crate) fn linux_hwcap() -> (usize, usize) {
4646
))]
4747
#[inline]
4848
pub(crate) fn linux_minsigstksz() -> usize {
49-
// FIXME: reuse const from libc when available?
50-
const AT_MINSIGSTKSZ: c::c_ulong = 51;
5149
if let Some(libc_getauxval) = getauxval.get() {
52-
unsafe { libc_getauxval(AT_MINSIGSTKSZ) as usize }
50+
unsafe { libc_getauxval(c::AT_MINSIGSTKSZ) as usize }
5351
} else {
5452
0
5553
}

src/backend/linux_raw/param/libc_auxv.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const AT_HWCAP2: c::c_ulong = 26;
3939
const AT_SECURE: c::c_ulong = 23;
4040
const AT_EXECFN: c::c_ulong = 31;
4141
const AT_SYSINFO_EHDR: c::c_ulong = 33;
42+
const AT_MINSIGSTKSZ: c::c_ulong = 51;
4243

4344
// Declare `sysconf` ourselves so that we don't depend on all of libc just for
4445
// this.
@@ -64,6 +65,7 @@ fn test_abi() {
6465
const_assert_eq!(self::AT_EXECFN, ::libc::AT_EXECFN);
6566
const_assert_eq!(self::AT_SECURE, ::libc::AT_SECURE);
6667
const_assert_eq!(self::AT_SYSINFO_EHDR, ::libc::AT_SYSINFO_EHDR);
68+
const_assert_eq!(self::AT_MINSIGSTKSZ, ::libc::AT_MINSIGSTKSZ);
6769
#[cfg(feature = "runtime")]
6870
const_assert_eq!(self::AT_PHDR, ::libc::AT_PHDR);
6971
#[cfg(feature = "runtime")]
@@ -111,9 +113,6 @@ pub(crate) fn linux_hwcap() -> (usize, usize) {
111113
#[cfg(feature = "param")]
112114
#[inline]
113115
pub(crate) fn linux_minsigstksz() -> usize {
114-
// FIXME: reuse const from libc when available?
115-
const AT_MINSIGSTKSZ: c::c_ulong = 51;
116-
117116
#[cfg(not(feature = "runtime"))]
118117
if let Some(libc_getauxval) = getauxval.get() {
119118
unsafe { libc_getauxval(AT_MINSIGSTKSZ) as usize }

tests/param/auxv.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ fn test_linux_minsigstksz() {
4949
weak!(fn getauxval(libc::c_ulong) -> libc::c_ulong);
5050

5151
if let Some(libc_getauxval) = getauxval.get() {
52-
// FIXME: reuse const from libc when available?
53-
const AT_MINSIGSTKSZ: libc::c_ulong = 51;
5452
assert_eq!(
5553
linux_minsigstksz(),
56-
unsafe { libc_getauxval(AT_MINSIGSTKSZ) } as usize
54+
unsafe { libc_getauxval(libc::AT_MINSIGSTKSZ) } as usize
5755
);
5856
}
5957
}

0 commit comments

Comments
 (0)