Skip to content

Commit

Permalink
Fix unresolved imports on AIX (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecnelises authored Jul 6, 2023
1 parent a6376c2 commit d46abbf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/backend/libc/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ pub(crate) use {

#[cfg(target_os = "vxworks")]
pub(super) use libc::_Vx_ticks64_t as _Vx_ticks_t;
#[cfg(target_os = "aix")]
pub(super) use libc::blksize64_t as blksize_t;
#[cfg(linux_kernel)]
pub(super) use libc::fallocate64 as fallocate;
#[cfg(not(any(target_arch = "aarch64", target_arch = "riscv64")))]
Expand All @@ -108,7 +106,15 @@ pub(super) use libc::open64 as open;
pub(super) use libc::posix_fallocate64 as posix_fallocate;
#[cfg(any(all(linux_like, not(target_os = "android")), target_os = "aix"))]
pub(super) use libc::{blkcnt64_t as blkcnt_t, rlim64_t as rlim_t};
#[cfg(any(linux_like, target_os = "aix"))]
#[cfg(target_os = "aix")]
pub(super) use libc::{
blksize64_t as blksize_t, fstat64 as fstat, fstatat, fstatfs64 as fstatfs,
fstatvfs64 as fstatvfs, ftruncate64 as ftruncate, getrlimit64 as getrlimit, ino_t,
lseek64 as lseek, mmap, off64_t as off_t, openat, posix_fadvise64 as posix_fadvise, preadv,
pwritev, rlimit64 as rlimit, setrlimit64 as setrlimit, statfs64 as statfs,
statvfs64 as statvfs, RLIM_INFINITY,
};
#[cfg(linux_like)]
pub(super) use libc::{
fstat64 as fstat, fstatat64 as fstatat, fstatfs64 as fstatfs, fstatvfs64 as fstatvfs,
ftruncate64 as ftruncate, getrlimit64 as getrlimit, ino64_t as ino_t, lseek64 as lseek,
Expand All @@ -126,7 +132,7 @@ pub(super) use libc::{
pub(super) use libc::{lstat64 as lstat, stat64 as stat};
#[cfg(any(linux_kernel, target_os = "aix", target_os = "emscripten"))]
pub(super) use libc::{pread64 as pread, pwrite64 as pwrite};
#[cfg(any(target_os = "aix", target_os = "linux", target_os = "emscripten"))]
#[cfg(any(target_os = "linux", target_os = "emscripten"))]
pub(super) use libc::{preadv64 as preadv, pwritev64 as pwritev};

#[cfg(all(target_os = "linux", target_env = "gnu"))]
Expand Down
2 changes: 1 addition & 1 deletion src/backend/libc/process/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ pub(crate) fn getgroups(buf: &mut [Gid]) -> io::Result<usize> {
unsafe { ret_usize(c::getgroups(len, buf.as_mut_ptr().cast()) as isize) }
}

#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(target_os = "aix", target_os = "redox", target_os = "wasi")))]
#[inline]
pub(crate) fn ioctl_tiocsctty(fd: BorrowedFd<'_>) -> io::Result<()> {
unsafe { ret(c::ioctl(borrowed_fd(fd), c::TIOCSCTTY as _, &0_u32)) }
Expand Down
8 changes: 7 additions & 1 deletion src/process/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ use backend::fd::AsFd;
/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=tty&sektion=4
/// [NetBSD]: https://man.netbsd.org/tty.4
/// [OpenBSD]: https://man.openbsd.org/tty.4
#[cfg(not(any(windows, target_os = "haiku", target_os = "redox", target_os = "wasi")))]
#[cfg(not(any(
windows,
target_os = "aix",
target_os = "haiku",
target_os = "redox",
target_os = "wasi"
)))]
#[inline]
#[doc(alias = "TIOCSCTTY")]
pub fn ioctl_tiocsctty<Fd: AsFd>(fd: Fd) -> io::Result<()> {
Expand Down

0 comments on commit d46abbf

Please sign in to comment.