Skip to content

Commit f60c7dc

Browse files
authored
Fix compilation with libc 0.2.150 on powerpc64-ibm-aix. (#919)
1 parent eb774c1 commit f60c7dc

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
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.8", default-features = false, features = ["general", "errno", "ioctl", "no_std", "elf"] }
4040
libc_errno = { package = "errno", version = "0.3.1", default-features = false, optional = true }
41-
libc = { version = "0.2.148", default-features = false, features = ["extra_traits"], optional = true }
41+
libc = { version = "0.2.150", default-features = false, features = ["extra_traits"], 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.1", default-features = false }
49-
libc = { version = "0.2.148", default-features = false, features = ["extra_traits"] }
49+
libc = { version = "0.2.150", default-features = false, features = ["extra_traits"] }
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.148"
77+
libc = "0.2.150"
7878
libc_errno = { package = "errno", version = "0.3.1", default-features = false }
7979
serial_test = "2.0.0"
8080
memoffset = "0.9.0"

src/backend/libc/c.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ pub(super) use libc::{
130130
blksize64_t as blksize_t, fstat64 as fstat, fstatfs64 as fstatfs, fstatvfs64 as fstatvfs,
131131
ftruncate64 as ftruncate, getrlimit64 as getrlimit, ino_t, lseek64 as lseek, mmap,
132132
off64_t as off_t, openat, posix_fadvise64 as posix_fadvise, preadv, pwritev,
133-
rlimit64 as rlimit, setrlimit64 as setrlimit, statfs64 as statfs, statvfs64 as statvfs,
134-
RLIM_INFINITY,
133+
rlimit64 as rlimit, setrlimit64 as setrlimit, stat64at as fstatat, statfs64 as statfs,
134+
statvfs64 as statvfs, RLIM_INFINITY,
135135
};
136136
#[cfg(any(linux_like, target_os = "hurd"))]
137137
pub(super) use libc::{

src/backend/libc/fs/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
660660
}
661661
}
662662

663-
#[cfg(not(any(target_os = "aix", target_os = "espidf", target_os = "redox")))]
663+
#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
664664
pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
665665
// See the comments in `fstat` about using `crate::fs::statx` here.
666666
#[cfg(all(

src/clockid.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ use crate::fd::BorrowedFd;
1111
/// [`clock_gettime`]: crate::time::clock_gettime
1212
#[cfg(not(any(apple, target_os = "wasi")))]
1313
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
14-
#[cfg_attr(not(target_os = "dragonfly"), repr(i32))]
14+
#[cfg_attr(not(any(target_os = "aix", target_os = "dragonfly")), repr(i32))]
1515
#[cfg_attr(target_os = "dragonfly", repr(u64))]
16+
#[cfg_attr(target_os = "aix", repr(i64))]
1617
#[non_exhaustive]
1718
pub enum ClockId {
1819
/// `CLOCK_REALTIME`

src/fs/at.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::fs::AtFlags;
1414
use crate::fs::CloneFlags;
1515
#[cfg(linux_kernel)]
1616
use crate::fs::RenameFlags;
17-
#[cfg(not(any(target_os = "aix", target_os = "espidf")))]
17+
#[cfg(not(target_os = "espidf"))]
1818
use crate::fs::Stat;
1919
#[cfg(not(any(apple, target_os = "espidf", target_os = "vita", target_os = "wasi")))]
2020
use crate::fs::{Dev, FileType};
@@ -288,8 +288,7 @@ pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
288288
/// [Linux]: https://man7.org/linux/man-pages/man2/fstatat.2.html
289289
/// [`Mode::from_raw_mode`]: crate::fs::Mode::from_raw_mode
290290
/// [`FileType::from_raw_mode`]: crate::fs::FileType::from_raw_mode
291-
// TODO: Add `stat64xat` to upstream libc bindings and reenable this for AIX.
292-
#[cfg(not(any(target_os = "aix", target_os = "espidf")))]
291+
#[cfg(not(target_os = "espidf"))]
293292
#[inline]
294293
#[doc(alias = "fstatat")]
295294
pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<Stat> {

0 commit comments

Comments
 (0)