// On PowerPC, the regular `termios` has the `termios2` fields and there is no // `termios2`. linux-raw-sys has aliases `termios2` to `termios` to cover this // difference, but we still need to manually import it since `libc` doesn't // have this. #[cfg(all(
linux_kernel,
feature = "termios",
any(target_arch = "powerpc", target_arch = "powerpc64")
))] pub(crate) use {
linux_raw_sys::general::{termios2, CIBAUD},
linux_raw_sys::ioctl::{TCGETS2, TCSETS2, TCSETSF2, TCSETSW2},
};
// Automatically enable “large file” support (LFS) features.
#[cfg(target_os = "vxworks")] pub(super) use libc::_Vx_ticks64_t as _Vx_ticks_t; #[cfg(linux_kernel)] pub(super) use libc::fallocate64 as fallocate; #[cfg(not(any(target_arch = "aarch64", target_arch = "riscv64")))] #[cfg(any(linux_like, target_os = "aix"))] pub(super) use libc::open64 as open; #[cfg(any(
linux_kernel,
target_os = "aix",
target_os = "hurd",
target_os = "l4re"
))] 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}; // TODO: AIX has `stat64x`, `fstat64x`, `lstat64x`, and `stat64xat`; add them // to the upstream libc crate and implement rustix's `statat` etc. with them. #[cfg(target_os = "aix")] pub(super) use libc::{
blksize64_t as blksize_t, fstat64 as fstat, 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, stat64at as fstatat, statfs64 as statfs,
statvfs64 as statvfs, RLIM_INFINITY,
}; #[cfg(any(linux_like, target_os = "hurd"))] 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,
mmap64 as mmap, off64_t as off_t, openat64 as openat, posix_fadvise64 as posix_fadvise,
rlimit64 as rlimit, setrlimit64 as setrlimit, statfs64 as statfs, statvfs64 as statvfs,
RLIM64_INFINITY as RLIM_INFINITY,
}; #[cfg(apple)] pub(super) use libc::{
host_info64_t as host_info_t, host_statistics64 as host_statistics,
vm_statistics64_t as vm_statistics_t,
}; #[cfg(not(all(
linux_kernel,
any(
target_pointer_width = "32",
target_arch = "mips64",
target_arch = "mips64r6"
)
)))] #[cfg(any(linux_like, target_os = "aix", target_os = "hurd"))] pub(super) use libc::{lstat64 as lstat, stat64 as stat}; #[cfg(any(
linux_kernel,
target_os = "aix",
target_os = "hurd",
target_os = "emscripten"
))] pub(super) use libc::{pread64 as pread, pwrite64 as pwrite}; #[cfg(any(target_os = "linux", target_os = "hurd", target_os = "emscripten"))] pub(super) use libc::{preadv64 as preadv, pwritev64 as pwritev};
// glibc added `preadv64v2` and `pwritev64v2` in version 2.26. #[cfg(all(target_os = "linux", target_env = "gnu"))] mod readwrite_pv64v2 { usesuper::*;
pub(insuper::super) unsafefn preadv64v2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset: libc::off64_t,
flags: libc::c_int,
) -> libc::ssize_t { // Older glibc lacks `preadv64v2`, so use the `weak!` mechanism to // test for it, and call back to `libc::syscall`. We don't use // `weak_or_syscall` here because we need to pass the 64-bit offset // specially.
weak! { fn preadv64v2(libc::c_int, *const libc::iovec, libc::c_int, libc::off64_t, libc::c_int) -> libc::ssize_t
} iflet Some(fun) = preadv64v2.get() {
fun(fd, iov, iovcnt, offset, flags)
} else { // Unlike the plain "p" functions, the "pv" functions pass their // offset in an endian-independent way, and always in two registers.
syscall! { fn preadv2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset_lo: usize,
offset_hi: usize,
flags: libc::c_int
) via SYS_preadv2 -> libc::ssize_t
}
preadv2(
fd,
iov,
iovcnt,
offset as usize,
(offset >> 32) as usize,
flags,
)
}
} pub(insuper::super) unsafefn pwritev64v2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset: libc::off64_t,
flags: libc::c_int,
) -> libc::ssize_t { // See the comments in `preadv64v2`.
weak! { fn pwritev64v2(libc::c_int, *const libc::iovec, libc::c_int, libc::off64_t, libc::c_int) -> libc::ssize_t
} iflet Some(fun) = pwritev64v2.get() {
fun(fd, iov, iovcnt, offset, flags)
} else { // Unlike the plain "p" functions, the "pv" functions pass their // offset in an endian-independent way, and always in two registers.
syscall! { fn pwritev2(
fd: libc::c_int,
iov: *const libc::iovec,
iovec: libc::c_int,
offset_lo: usize,
offset_hi: usize,
flags: libc::c_int
) via SYS_pwritev2 -> libc::ssize_t
}
pwritev2(
fd,
iov,
iovcnt,
offset as usize,
(offset >> 32) as usize,
flags,
)
}
}
} #[cfg(all(target_os = "linux", target_env = "gnu"))] pub(super) use readwrite_pv64v2::{preadv64v2 as preadv2, pwritev64v2 as pwritev2};
// On non-glibc, assume we don't have `pwritev2`/`preadv2` in libc and use // `c::syscall` instead. #[cfg(any(
target_os = "android",
all(target_os = "linux", not(target_env = "gnu")),
))] mod readwrite_pv64v2 { usesuper::*;
pub(insuper::super) unsafefn preadv64v2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset: libc::off64_t,
flags: libc::c_int,
) -> libc::ssize_t { // Unlike the plain "p" functions, the "pv" functions pass their offset // in an endian-independent way, and always in two registers.
syscall! { fn preadv2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset_lo: usize,
offset_hi: usize,
flags: libc::c_int
) via SYS_preadv2 -> libc::ssize_t
}
preadv2(
fd,
iov,
iovcnt,
offset as usize,
(offset >> 32) as usize,
flags,
)
} pub(insuper::super) unsafefn pwritev64v2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset: libc::off64_t,
flags: libc::c_int,
) -> libc::ssize_t { // Unlike the plain "p" functions, the "pv" functions pass their offset // in an endian-independent way, and always in two registers.
syscall! { fn pwritev2(
fd: libc::c_int,
iov: *const libc::iovec,
iovcnt: libc::c_int,
offset_lo: usize,
offset_hi: usize,
flags: libc::c_int
) via SYS_pwritev2 -> libc::ssize_t
}
pwritev2(
fd,
iov,
iovcnt,
offset as usize,
(offset >> 32) as usize,
flags,
)
}
} #[cfg(any(
target_os = "android",
all(target_os = "linux", not(target_env = "gnu")),
))] pub(super) use readwrite_pv64v2::{preadv64v2 as preadv2, pwritev64v2 as pwritev2};
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.