summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src')
-rw-r--r--vendor/rustix/src/backend/libc/c.rs29
-rw-r--r--vendor/rustix/src/backend/libc/conv.rs36
-rw-r--r--vendor/rustix/src/backend/libc/event/poll_fd.rs6
-rw-r--r--vendor/rustix/src/backend/libc/event/syscalls.rs14
-rw-r--r--vendor/rustix/src/backend/libc/fs/dir.rs23
-rw-r--r--vendor/rustix/src/backend/libc/fs/mod.rs9
-rw-r--r--vendor/rustix/src/backend/libc/fs/syscalls.rs352
-rw-r--r--vendor/rustix/src/backend/libc/fs/types.rs192
-rw-r--r--vendor/rustix/src/backend/libc/io/errno.rs254
-rw-r--r--vendor/rustix/src/backend/libc/io/syscalls.rs63
-rw-r--r--vendor/rustix/src/backend/libc/mm/types.rs39
-rw-r--r--vendor/rustix/src/backend/libc/mod.rs13
-rw-r--r--vendor/rustix/src/backend/libc/mount/mod.rs2
-rw-r--r--vendor/rustix/src/backend/libc/mount/syscalls.rs272
-rw-r--r--vendor/rustix/src/backend/libc/mount/types.rs311
-rw-r--r--vendor/rustix/src/backend/libc/net/addr.rs16
-rw-r--r--vendor/rustix/src/backend/libc/net/ext.rs4
-rw-r--r--vendor/rustix/src/backend/libc/net/mod.rs2
-rw-r--r--vendor/rustix/src/backend/libc/net/read_sockaddr.rs6
-rw-r--r--vendor/rustix/src/backend/libc/net/send_recv.rs7
-rw-r--r--vendor/rustix/src/backend/libc/net/syscalls.rs64
-rw-r--r--vendor/rustix/src/backend/libc/net/write_sockaddr.rs6
-rw-r--r--vendor/rustix/src/backend/libc/pipe/syscalls.rs24
-rw-r--r--vendor/rustix/src/backend/libc/pipe/types.rs7
-rw-r--r--vendor/rustix/src/backend/libc/process/mod.rs2
-rw-r--r--vendor/rustix/src/backend/libc/process/syscalls.rs129
-rw-r--r--vendor/rustix/src/backend/libc/process/types.rs56
-rw-r--r--vendor/rustix/src/backend/libc/pty/syscalls.rs21
-rw-r--r--vendor/rustix/src/backend/libc/system/syscalls.rs24
-rw-r--r--vendor/rustix/src/backend/libc/termios/syscalls.rs62
-rw-r--r--vendor/rustix/src/backend/libc/thread/syscalls.rs234
-rw-r--r--vendor/rustix/src/backend/libc/time/syscalls.rs401
-rw-r--r--vendor/rustix/src/backend/libc/time/types.rs46
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/aarch64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/aarch64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/arm.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/arm.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/mips.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs543
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/mips64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs470
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/mod.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/mod.rs)2
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/powerpc64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/powerpc64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/riscv64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/riscv64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/thumb.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/thumb.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/x86.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/x86.rs)12
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/asm/x86_64.rs (renamed from vendor/rustix/src/backend/linux_raw/arch/inline/x86_64.rs)0
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/mod.rs16
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/mips.s211
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s189
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs28
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs166
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s132
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs285
-rw-r--r--vendor/rustix/src/backend/linux_raw/arch/outline/x86.s381
-rw-r--r--vendor/rustix/src/backend/linux_raw/c.rs14
-rw-r--r--vendor/rustix/src/backend/linux_raw/conv.rs80
-rw-r--r--vendor/rustix/src/backend/linux_raw/elf.rs7
-rw-r--r--vendor/rustix/src/backend/linux_raw/fs/syscalls.rs125
-rw-r--r--vendor/rustix/src/backend/linux_raw/fs/types.rs124
-rw-r--r--vendor/rustix/src/backend/linux_raw/io/syscalls.rs65
-rw-r--r--vendor/rustix/src/backend/linux_raw/mm/types.rs63
-rw-r--r--vendor/rustix/src/backend/linux_raw/mod.rs4
-rw-r--r--vendor/rustix/src/backend/linux_raw/mount/mod.rs2
-rw-r--r--vendor/rustix/src/backend/linux_raw/mount/syscalls.rs239
-rw-r--r--vendor/rustix/src/backend/linux_raw/mount/types.rs303
-rw-r--r--vendor/rustix/src/backend/linux_raw/net/syscalls.rs4
-rw-r--r--vendor/rustix/src/backend/linux_raw/param/auxv.rs6
-rw-r--r--vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs20
-rw-r--r--vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs4
-rw-r--r--vendor/rustix/src/backend/linux_raw/process/syscalls.rs1
-rw-r--r--vendor/rustix/src/backend/linux_raw/pty/syscalls.rs2
-rw-r--r--vendor/rustix/src/backend/linux_raw/reg.rs13
-rw-r--r--vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs12
-rw-r--r--vendor/rustix/src/backend/linux_raw/termios/syscalls.rs7
-rw-r--r--vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs56
-rw-r--r--vendor/rustix/src/check_types.rs70
-rw-r--r--vendor/rustix/src/clockid.rs11
-rw-r--r--vendor/rustix/src/cstr.rs4
-rw-r--r--vendor/rustix/src/fs/abs.rs9
-rw-r--r--vendor/rustix/src/fs/at.rs27
-rw-r--r--vendor/rustix/src/fs/constants.rs6
-rw-r--r--vendor/rustix/src/fs/cwd.rs2
-rw-r--r--vendor/rustix/src/fs/fcntl.rs4
-rw-r--r--vendor/rustix/src/fs/fcntl_apple.rs42
-rw-r--r--vendor/rustix/src/fs/fd.rs14
-rw-r--r--vendor/rustix/src/fs/mod.rs34
-rw-r--r--vendor/rustix/src/fs/mount.rs209
-rw-r--r--vendor/rustix/src/io/dup.rs7
-rw-r--r--vendor/rustix/src/io/errno.rs6
-rw-r--r--vendor/rustix/src/io/fcntl.rs2
-rw-r--r--vendor/rustix/src/io/ioctl.rs1
-rw-r--r--vendor/rustix/src/io/read_write.rs18
-rw-r--r--vendor/rustix/src/lib.rs44
-rw-r--r--vendor/rustix/src/mm/mmap.rs3
-rw-r--r--vendor/rustix/src/mount/fsopen.rs219
-rw-r--r--vendor/rustix/src/mount/mod.rs19
-rw-r--r--vendor/rustix/src/mount/mount_unmount.rs175
-rw-r--r--vendor/rustix/src/mount/types.rs1
-rw-r--r--vendor/rustix/src/net/send_recv/mod.rs4
-rw-r--r--vendor/rustix/src/net/send_recv/msg.rs20
-rw-r--r--vendor/rustix/src/net/sockopt.rs3
-rw-r--r--vendor/rustix/src/net/types.rs158
-rw-r--r--vendor/rustix/src/pid.rs16
-rw-r--r--vendor/rustix/src/pipe.rs10
-rw-r--r--vendor/rustix/src/process/exit.rs2
-rw-r--r--vendor/rustix/src/process/ioctl.rs2
-rw-r--r--vendor/rustix/src/process/mod.rs24
-rw-r--r--vendor/rustix/src/process/priority.rs7
-rw-r--r--vendor/rustix/src/process/wait.rs10
-rw-r--r--vendor/rustix/src/procfs.rs2
-rw-r--r--vendor/rustix/src/pty.rs2
-rw-r--r--vendor/rustix/src/signal.rs14
-rw-r--r--vendor/rustix/src/static_assertions.rs37
-rw-r--r--vendor/rustix/src/system.rs23
-rw-r--r--vendor/rustix/src/termios/ioctl.rs4
-rw-r--r--vendor/rustix/src/termios/mod.rs8
-rw-r--r--vendor/rustix/src/termios/tc.rs10
-rw-r--r--vendor/rustix/src/termios/types.rs297
-rw-r--r--vendor/rustix/src/thread/clock.rs4
-rw-r--r--vendor/rustix/src/thread/id.rs4
-rw-r--r--vendor/rustix/src/thread/setns.rs4
-rw-r--r--vendor/rustix/src/timespec.rs68
-rw-r--r--vendor/rustix/src/ugid.rs17
-rw-r--r--vendor/rustix/src/utils.rs4
123 files changed, 5038 insertions, 2955 deletions
diff --git a/vendor/rustix/src/backend/libc/c.rs b/vendor/rustix/src/backend/libc/c.rs
index 90d3c26f3..f9e94416c 100644
--- a/vendor/rustix/src/backend/libc/c.rs
+++ b/vendor/rustix/src/backend/libc/c.rs
@@ -12,10 +12,6 @@ pub(crate) const PROC_SUPER_MAGIC: u32 = 0x0000_9fa0;
#[cfg(all(linux_kernel, target_env = "musl"))]
pub(crate) const NFS_SUPER_MAGIC: u32 = 0x0000_6969;
-// Submitted upstream in <https://github.com/rust-lang/libc/pull/3272>.
-#[cfg(all(linux_kernel, feature = "net"))]
-pub(crate) const IPPROTO_ETHERNET: c_int = linux_raw_sys::net::IPPROTO_ETHERNET as _;
-
// TODO: Upstream these.
#[cfg(all(linux_kernel, feature = "net"))]
pub(crate) const ETH_P_TSN: c_int = linux_raw_sys::if_ether::ETH_P_TSN as _;
@@ -66,7 +62,9 @@ pub(crate) const ETH_P_MCTP: c_int = linux_raw_sys::if_ether::ETH_P_MCTP as _;
linux_kernel,
any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
)
@@ -97,8 +95,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")))]
@@ -108,7 +104,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,
@@ -121,12 +125,19 @@ 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"))))]
+#[cfg(not(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+)))]
#[cfg(any(linux_like, target_os = "aix"))]
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"))]
diff --git a/vendor/rustix/src/backend/libc/conv.rs b/vendor/rustix/src/backend/libc/conv.rs
index d6bcc16ee..baf2a05ed 100644
--- a/vendor/rustix/src/backend/libc/conv.rs
+++ b/vendor/rustix/src/backend/libc/conv.rs
@@ -2,10 +2,10 @@
//! `c_uint`, or libc-specific pointer types. This module provides functions
//! for converting between rustix's types and libc types.
-#![allow(dead_code)]
-
use super::c;
-use super::fd::{AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, LibcFd, OwnedFd, RawFd};
+#[cfg(not(any(windows, target_os = "espidf")))]
+use super::fd::IntoRawFd;
+use super::fd::{AsRawFd, BorrowedFd, FromRawFd, LibcFd, OwnedFd, RawFd};
#[cfg(not(windows))]
use crate::ffi::CStr;
use crate::io;
@@ -16,7 +16,7 @@ pub(super) fn c_str(c: &CStr) -> *const c::c_char {
c.as_ptr()
}
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(super) fn no_fd() -> LibcFd {
-1
@@ -27,6 +27,7 @@ pub(super) fn borrowed_fd(fd: BorrowedFd<'_>) -> LibcFd {
fd.as_raw_fd() as LibcFd
}
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox")))]
#[inline]
pub(super) fn owned_fd(fd: OwnedFd) -> LibcFd {
fd.into_raw_fd() as LibcFd
@@ -41,6 +42,7 @@ pub(super) fn ret(raw: c::c_int) -> io::Result<()> {
}
}
+#[cfg(apple)]
#[inline]
pub(super) fn nonnegative_ret(raw: c::c_int) -> io::Result<()> {
if raw >= 0 {
@@ -50,6 +52,7 @@ pub(super) fn nonnegative_ret(raw: c::c_int) -> io::Result<()> {
}
}
+#[cfg(not(any(windows, target_os = "wasi")))]
#[inline]
pub(super) unsafe fn ret_infallible(raw: c::c_int) {
debug_assert_eq!(raw, 0, "unexpected error: {:?}", io::Errno::last_os_error());
@@ -64,6 +67,7 @@ pub(super) fn ret_c_int(raw: c::c_int) -> io::Result<c::c_int> {
}
}
+#[cfg(linux_kernel)]
#[inline]
pub(super) fn ret_u32(raw: c::c_int) -> io::Result<u32> {
if raw == -1 {
@@ -94,7 +98,7 @@ pub(super) fn ret_off_t(raw: c::off_t) -> io::Result<c::off_t> {
}
}
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "wasi")))]
#[inline]
pub(super) fn ret_pid_t(raw: c::pid_t) -> io::Result<c::pid_t> {
if raw == -1 {
@@ -119,6 +123,7 @@ pub(super) unsafe fn ret_owned_fd(raw: LibcFd) -> io::Result<OwnedFd> {
}
}
+#[cfg(not(any(windows, target_os = "wasi")))]
#[inline]
pub(super) fn ret_discarded_fd(raw: LibcFd) -> io::Result<()> {
if raw == !0 {
@@ -128,6 +133,7 @@ pub(super) fn ret_discarded_fd(raw: LibcFd) -> io::Result<()> {
}
}
+#[cfg(not(any(windows, target_os = "wasi")))]
#[inline]
pub(super) fn ret_discarded_char_ptr(raw: *mut c::c_char) -> io::Result<()> {
if raw.is_null() {
@@ -138,7 +144,7 @@ pub(super) fn ret_discarded_char_ptr(raw: *mut c::c_char) -> io::Result<()> {
}
/// Convert the buffer-length argument value of a `send` or `recv` call.
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
#[inline]
pub(super) fn send_recv_len(len: usize) -> usize {
len
@@ -155,7 +161,7 @@ pub(super) fn send_recv_len(len: usize) -> i32 {
}
/// Convert the return value of a `send` or `recv` call.
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
#[inline]
pub(super) fn ret_send_recv(len: isize) -> io::Result<usize> {
ret_usize(len)
@@ -170,7 +176,7 @@ pub(super) fn ret_send_recv(len: i32) -> io::Result<usize> {
/// Convert the value to the `msg_iovlen` field of a `msghdr` struct.
#[cfg(all(
- not(any(windows, target_os = "wasi")),
+ not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")),
any(
target_os = "android",
all(target_os = "linux", not(target_env = "musl"))
@@ -183,7 +189,7 @@ pub(super) fn msg_iov_len(len: usize) -> c::size_t {
/// Convert the value to the `msg_iovlen` field of a `msghdr` struct.
#[cfg(all(
- not(any(windows, target_os = "wasi")),
+ not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")),
not(any(
target_os = "android",
all(target_os = "linux", not(target_env = "musl"))
@@ -200,8 +206,9 @@ pub(crate) fn msg_iov_len(len: usize) -> c::c_int {
solarish,
target_env = "musl",
target_os = "emscripten",
+ target_os = "fuchsia",
target_os = "haiku",
- target_os = "fuchsia"
+ target_os = "nto",
))]
#[inline]
pub(crate) fn msg_control_len(len: usize) -> c::socklen_t {
@@ -212,12 +219,15 @@ pub(crate) fn msg_control_len(len: usize) -> c::socklen_t {
#[cfg(not(any(
bsd,
solarish,
+ windows,
target_env = "musl",
target_os = "emscripten",
- target_os = "haiku",
+ target_os = "espidf",
target_os = "fuchsia",
- windows,
- target_os = "wasi"
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "redox",
+ target_os = "wasi",
)))]
#[inline]
pub(crate) fn msg_control_len(len: usize) -> c::size_t {
diff --git a/vendor/rustix/src/backend/libc/event/poll_fd.rs b/vendor/rustix/src/backend/libc/event/poll_fd.rs
index 49a6d1126..a06812aaa 100644
--- a/vendor/rustix/src/backend/libc/event/poll_fd.rs
+++ b/vendor/rustix/src/backend/libc/event/poll_fd.rs
@@ -26,18 +26,20 @@ bitflags! {
/// `POLLRDNORM`
const RDNORM = c::POLLRDNORM;
/// `POLLWRNORM`
+ #[cfg(not(target_os = "l4re"))]
const WRNORM = c::POLLWRNORM;
/// `POLLRDBAND`
- #[cfg(not(target_os = "wasi"))]
+ #[cfg(not(any(target_os = "l4re", target_os = "wasi")))]
const RDBAND = c::POLLRDBAND;
/// `POLLWRBAND`
- #[cfg(not(target_os = "wasi"))]
+ #[cfg(not(any(target_os = "l4re", target_os = "wasi")))]
const WRBAND = c::POLLWRBAND;
/// `POLLERR`
const ERR = c::POLLERR;
/// `POLLHUP`
const HUP = c::POLLHUP;
/// `POLLNVAL`
+ #[cfg(not(target_os = "espidf"))]
const NVAL = c::POLLNVAL;
/// `POLLRDHUP`
#[cfg(all(
diff --git a/vendor/rustix/src/backend/libc/event/syscalls.rs b/vendor/rustix/src/backend/libc/event/syscalls.rs
index 11f6af83e..eac88d4bb 100644
--- a/vendor/rustix/src/backend/libc/event/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/event/syscalls.rs
@@ -33,7 +33,19 @@ pub(crate) fn eventfd(initval: u32, flags: EventfdFlags) -> io::Result<OwnedFd>
ret_owned_fd(eventfd2(initval, bitflags_bits!(flags)))
}
- #[cfg(any(target_os = "freebsd", target_os = "illumos"))]
+ // `eventfd` was added in FreeBSD 13, so it isn't available on FreeBSD 12.
+ #[cfg(target_os = "freebsd")]
+ unsafe {
+ weakcall! {
+ fn eventfd(
+ initval: c::c_uint,
+ flags: c::c_int
+ ) -> c::c_int
+ }
+ ret_owned_fd(eventfd(initval, bitflags_bits!(flags)))
+ }
+
+ #[cfg(target_os = "illumos")]
unsafe {
ret_owned_fd(c::eventfd(initval, bitflags_bits!(flags)))
}
diff --git a/vendor/rustix/src/backend/libc/fs/dir.rs b/vendor/rustix/src/backend/libc/fs/dir.rs
index c8a4d77c9..6cfeb242b 100644
--- a/vendor/rustix/src/backend/libc/fs/dir.rs
+++ b/vendor/rustix/src/backend/libc/fs/dir.rs
@@ -1,4 +1,4 @@
-#[cfg(not(any(solarish, target_os = "haiku")))]
+#[cfg(not(any(solarish, target_os = "haiku", target_os = "nto")))]
use super::types::FileType;
use crate::backend::c;
use crate::backend::conv::owned_fd;
@@ -9,6 +9,7 @@ use crate::fs::{fcntl_getfl, fstat, openat, Mode, OFlags, Stat};
solarish,
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -94,7 +95,12 @@ impl Dir {
check_dirent_layout(dirent);
let result = DirEntry {
- #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
d_type: dirent.d_type,
#[cfg(not(any(freebsdlike, netbsdlike)))]
@@ -122,6 +128,7 @@ impl Dir {
solarish,
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -180,7 +187,7 @@ impl fmt::Debug for Dir {
/// `struct dirent`
#[derive(Debug)]
pub struct DirEntry {
- #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku", target_os = "nto")))]
d_type: u8,
#[cfg(not(any(freebsdlike, netbsdlike)))]
@@ -200,7 +207,7 @@ impl DirEntry {
}
/// Returns the type of this directory entry.
- #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku", target_os = "nto")))]
#[inline]
pub fn file_type(&self) -> FileType {
FileType::from_dirent_d_type(self.d_type)
@@ -242,11 +249,13 @@ struct libc_dirent {
#[cfg(target_os = "openbsd")]
fn check_dirent_layout(dirent: &c::dirent) {
use crate::utils::as_ptr;
- use core::mem::{align_of, size_of};
// Check that the basic layouts match.
- assert_eq!(size_of::<libc_dirent>(), size_of::<c::dirent>());
- assert_eq!(align_of::<libc_dirent>(), align_of::<c::dirent>());
+ #[cfg(test)]
+ {
+ assert_eq_size!(libc_dirent, c::dirent);
+ assert_eq_size!(libc_dirent, c::dirent);
+ }
// Check that the field offsets match.
assert_eq!(
diff --git a/vendor/rustix/src/backend/libc/fs/mod.rs b/vendor/rustix/src/backend/libc/fs/mod.rs
index 28579c993..17b4da70f 100644
--- a/vendor/rustix/src/backend/libc/fs/mod.rs
+++ b/vendor/rustix/src/backend/libc/fs/mod.rs
@@ -1,8 +1,13 @@
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub(crate) mod dir;
#[cfg(linux_kernel)]
pub mod inotify;
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub(crate) mod makedev;
#[cfg(not(windows))]
pub(crate) mod syscalls;
diff --git a/vendor/rustix/src/backend/libc/fs/syscalls.rs b/vendor/rustix/src/backend/libc/fs/syscalls.rs
index bdba777e9..698bf34ad 100644
--- a/vendor/rustix/src/backend/libc/fs/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/fs/syscalls.rs
@@ -13,21 +13,24 @@ use crate::ffi::CString;
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
use crate::fs::Advice;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
use crate::fs::AtFlags;
#[cfg(not(any(
netbsdlike,
solarish,
target_os = "aix",
target_os = "dragonfly",
+ target_os = "espidf",
+ target_os = "nto",
target_os = "redox",
)))]
use crate::fs::FallocateFlags;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
use crate::fs::FlockOperation;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
use crate::fs::MemfdFlags;
@@ -35,30 +38,26 @@ use crate::fs::MemfdFlags;
use crate::fs::SealFlags;
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
use crate::fs::StatFs;
-use crate::fs::{Access, Mode, OFlags, SeekFrom, Stat, Timestamps};
-#[cfg(not(any(apple, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(target_os = "espidf"))]
+use crate::fs::{Access, Timestamps};
+#[cfg(not(any(apple, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
use crate::fs::{Dev, FileType};
+use crate::fs::{Mode, OFlags, SeekFrom, Stat};
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
use crate::fs::{StatVfs, StatVfsMountFlags};
use crate::io;
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
use crate::timespec::LibcTimespec;
#[cfg(not(target_os = "wasi"))]
use crate::ugid::{Gid, Uid};
-#[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-)))]
-use crate::utils::as_ptr;
#[cfg(apple)]
use alloc::vec;
use core::mem::MaybeUninit;
@@ -75,15 +74,9 @@ use {
core::ptr::null,
};
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __utimensat64(c::c_int, *const c::c_char, *const LibcTimespec, c::c_int) -> c::c_int);
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __futimens64(c::c_int, *const LibcTimespec) -> c::c_int);
/// Use a direct syscall (via libc) for `open`.
@@ -91,14 +84,25 @@ weak!(fn __futimens64(c::c_int, *const LibcTimespec) -> c::c_int);
/// This is only currently necessary as a workaround for old glibc; see below.
#[cfg(all(unix, target_env = "gnu"))]
fn open_via_syscall(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<OwnedFd> {
- // Linux on aarch64 and riscv64 has no `open` syscall so use `openat`.
- #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
+ // Linux on aarch64, loongarch64 and riscv64 has no `open` syscall so use
+ // `openat`.
+ #[cfg(any(
+ target_arch = "aarch64",
+ target_arch = "riscv32",
+ target_arch = "riscv64",
+ target_arch = "loongarch64"
+ ))]
{
openat_via_syscall(CWD, path, oflags, mode)
}
// Use the `open` syscall.
- #[cfg(not(any(target_arch = "aarch64", target_arch = "riscv64")))]
+ #[cfg(not(any(
+ target_arch = "aarch64",
+ target_arch = "riscv32",
+ target_arch = "riscv64",
+ target_arch = "loongarch64"
+ )))]
unsafe {
syscall! {
fn open(
@@ -216,8 +220,10 @@ pub(crate) fn openat(
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -243,11 +249,9 @@ pub(crate) fn statvfs(filename: &CStr) -> io::Result<StatVfs> {
#[inline]
pub(crate) fn readlink(path: &CStr, buf: &mut [u8]) -> io::Result<usize> {
unsafe {
- ret_usize(c::readlink(
- c_str(path),
- buf.as_mut_ptr().cast::<c::c_char>(),
- buf.len(),
- ))
+ ret_usize(
+ c::readlink(c_str(path), buf.as_mut_ptr().cast::<c::c_char>(), buf.len()) as isize,
+ )
}
}
@@ -264,7 +268,7 @@ pub(crate) fn readlinkat(
c_str(path),
buf.as_mut_ptr().cast::<c::c_char>(),
buf.len(),
- ))
+ ) as isize)
}
}
@@ -308,7 +312,7 @@ pub(crate) fn link(old_path: &CStr, new_path: &CStr) -> io::Result<()> {
unsafe { ret(c::link(c_str(old_path), c_str(new_path))) }
}
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub(crate) fn linkat(
old_dirfd: BorrowedFd<'_>,
old_path: &CStr,
@@ -371,7 +375,7 @@ pub(crate) fn unlink(path: &CStr) -> io::Result<()> {
unsafe { ret(c::unlink(c_str(path))) }
}
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub(crate) fn unlinkat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<()> {
// macOS <= 10.9 lacks `unlinkat`.
#[cfg(target_os = "macos")]
@@ -533,7 +537,14 @@ pub(crate) fn symlinkat(
pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64")))]
+ #[cfg(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ ))]
{
match crate::fs::statx(
crate::fs::CWD,
@@ -549,7 +560,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
// there's nothing practical we can do.
- #[cfg(not(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64"))))]
+ #[cfg(not(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ )))]
unsafe {
let mut stat = MaybeUninit::<Stat>::uninit();
ret(c::stat(c_str(path), stat.as_mut_ptr()))?;
@@ -559,7 +577,14 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64")))]
+ #[cfg(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ ))]
{
match crate::fs::statx(
crate::fs::CWD,
@@ -568,14 +593,21 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
StatxFlags::BASIC_STATS,
) {
Ok(x) => statx_to_stat(x),
- Err(io::Errno::NOSYS) => statat_old(crate::fs::CWD, path, AtFlags::empty()),
+ Err(io::Errno::NOSYS) => statat_old(crate::fs::CWD, path, AtFlags::SYMLINK_NOFOLLOW),
Err(err) => Err(err),
}
}
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
// there's nothing practical we can do.
- #[cfg(not(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64"))))]
+ #[cfg(not(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ )))]
unsafe {
let mut stat = MaybeUninit::<Stat>::uninit();
ret(c::lstat(c_str(path), stat.as_mut_ptr()))?;
@@ -583,10 +615,17 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
}
}
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64")))]
+ #[cfg(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ ))]
{
match crate::fs::statx(dirfd, path, flags, StatxFlags::BASIC_STATS) {
Ok(x) => statx_to_stat(x),
@@ -597,7 +636,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
// there's nothing practical we can do.
- #[cfg(not(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64"))))]
+ #[cfg(not(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ )))]
unsafe {
let mut stat = MaybeUninit::<Stat>::uninit();
ret(c::fstatat(
@@ -610,7 +656,14 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
}
}
-#[cfg(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64")))]
+#[cfg(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+))]
fn statat_old(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
unsafe {
let mut result = MaybeUninit::<c::stat64>::uninit();
@@ -624,12 +677,12 @@ fn statat_old(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<
}
}
-#[cfg(not(target_os = "emscripten"))]
+#[cfg(not(any(target_os = "espidf", target_os = "emscripten")))]
pub(crate) fn access(path: &CStr, access: Access) -> io::Result<()> {
unsafe { ret(c::access(c_str(path), access.bits())) }
}
-#[cfg(not(any(target_os = "emscripten", target_os = "redox")))]
+#[cfg(not(any(target_os = "emscripten", target_os = "espidf", target_os = "redox")))]
pub(crate) fn accessat(
dirfd: BorrowedFd<'_>,
path: &CStr,
@@ -695,47 +748,43 @@ pub(crate) fn accessat(
Ok(())
}
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub(crate) fn utimensat(
dirfd: BorrowedFd<'_>,
path: &CStr,
times: &Timestamps,
flags: AtFlags,
) -> io::Result<()> {
- // 32-bit gnu version: libc has `utimensat` but it is not y2038 safe by
- // default.
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
+ // Old 32-bit version: libc has `utimensat` but it is not y2038 safe by
+ // default. But there may be a `__utimensat16` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_utimensat) = __utimensat64.get() {
let libc_times: [LibcTimespec; 2] = [
times.last_access.clone().into(),
times.last_modification.clone().into(),
];
- ret(libc_utimensat(
- borrowed_fd(dirfd),
- c_str(path),
- libc_times.as_ptr(),
- bitflags_bits!(flags),
- ))
- } else {
- utimensat_old(dirfd, path, times, flags)
+ unsafe {
+ return ret(libc_utimensat(
+ borrowed_fd(dirfd),
+ c_str(path),
+ libc_times.as_ptr(),
+ bitflags_bits!(flags),
+ ));
+ }
}
+
+ utimensat_old(dirfd, path, times, flags)
}
// Main version: libc is y2038 safe and has `utimensat`. Or, the platform
// is not y2038 safe and there's nothing practical we can do.
- #[cfg(not(any(
- apple,
- all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )
- )))]
+ #[cfg(not(any(apple, fix_y2038)))]
unsafe {
+ use crate::utils::as_ptr;
+
// Assert that `Timestamps` has the expected layout.
let _ = core::mem::transmute::<Timestamps, [c::timespec; 2]>(times.clone());
@@ -747,9 +796,11 @@ pub(crate) fn utimensat(
))
}
- // `utimensat` was introduced in macOS 10.13.
+ // Apple version: `utimensat` was introduced in macOS 10.13.
#[cfg(apple)]
unsafe {
+ use crate::utils::as_ptr;
+
// ABI details
weak! {
fn utimensat(
@@ -863,11 +914,8 @@ pub(crate) fn utimensat(
}
}
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
-unsafe fn utimensat_old(
+#[cfg(fix_y2038)]
+fn utimensat_old(
dirfd: BorrowedFd<'_>,
path: &CStr,
times: &Timestamps,
@@ -891,12 +939,14 @@ unsafe fn utimensat_old(
tv_nsec: times.last_modification.tv_nsec,
},
];
- ret(c::utimensat(
- borrowed_fd(dirfd),
- c_str(path),
- old_times.as_ptr(),
- bitflags_bits!(flags),
- ))
+ unsafe {
+ ret(c::utimensat(
+ borrowed_fd(dirfd),
+ c_str(path),
+ old_times.as_ptr(),
+ bitflags_bits!(flags),
+ ))
+ }
}
#[cfg(not(target_os = "wasi"))]
@@ -904,7 +954,12 @@ pub(crate) fn chmod(path: &CStr, mode: Mode) -> io::Result<()> {
unsafe { ret(c::chmod(c_str(path), mode.bits() as c::mode_t)) }
}
-#[cfg(not(any(linux_kernel, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ linux_kernel,
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub(crate) fn chmodat(
dirfd: BorrowedFd<'_>,
path: &CStr,
@@ -982,7 +1037,7 @@ pub(crate) fn fclonefileat(
}
}
-#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn chownat(
dirfd: BorrowedFd<'_>,
path: &CStr,
@@ -1002,7 +1057,7 @@ pub(crate) fn chownat(
}
}
-#[cfg(not(any(apple, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(apple, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn mknodat(
dirfd: BorrowedFd<'_>,
path: &CStr,
@@ -1039,7 +1094,8 @@ pub(crate) fn copy_file_range(
) via SYS_copy_file_range -> c::ssize_t
}
- assert_eq!(size_of::<c::loff_t>(), size_of::<u64>());
+ #[cfg(test)]
+ assert_eq_size!(c::loff_t, u64);
let mut off_in_val: c::loff_t = 0;
let mut off_out_val: c::loff_t = 0;
@@ -1080,6 +1136,7 @@ pub(crate) fn copy_file_range(
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -1135,6 +1192,7 @@ pub(crate) fn fcntl_add_seals(fd: BorrowedFd<'_>, seals: SealFlags) -> io::Resul
#[cfg(not(any(
target_os = "emscripten",
+ target_os = "espidf",
target_os = "fuchsia",
target_os = "redox",
target_os = "wasi"
@@ -1168,7 +1226,7 @@ pub(crate) fn fcntl_lock(fd: BorrowedFd<'_>, operation: FlockOperation) -> io::R
}
pub(crate) fn seek(fd: BorrowedFd<'_>, pos: SeekFrom) -> io::Result<u64> {
- let (whence, offset): (c::c_int, c::off_t) = match pos {
+ let (whence, offset) = match pos {
SeekFrom::Start(pos) => {
let pos: u64 = pos;
// Silently cast; we'll get `EINVAL` if the value is negative.
@@ -1181,6 +1239,11 @@ pub(crate) fn seek(fd: BorrowedFd<'_>, pos: SeekFrom) -> io::Result<u64> {
#[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
SeekFrom::Hole(offset) => (c::SEEK_HOLE, offset),
};
+
+ // ESP-IDF doesn't support 64-bit offsets.
+ #[cfg(target_os = "espidf")]
+ let offset: i32 = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?;
+
let offset = unsafe { ret_off_t(c::lseek(borrowed_fd(fd), offset, whence))? };
Ok(offset as u64)
}
@@ -1237,7 +1300,7 @@ pub(crate) fn fchown(fd: BorrowedFd<'_>, owner: Option<Uid>, group: Option<Gid>)
}
}
-#[cfg(not(any(target_os = "solaris", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "solaris", target_os = "wasi")))]
pub(crate) fn flock(fd: BorrowedFd<'_>, operation: FlockOperation) -> io::Result<()> {
unsafe { ret(c::flock(borrowed_fd(fd), operation as c::c_int)) }
}
@@ -1259,7 +1322,7 @@ pub(crate) fn syncfs(fd: BorrowedFd<'_>) -> io::Result<()> {
unsafe { ret(syncfs(borrowed_fd(fd))) }
}
-#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn sync() {
unsafe { c::sync() }
}
@@ -1271,7 +1334,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
// And, some old platforms don't support `statx`, and some fail with a
// confusing error code, so we call `crate::fs::statx` to handle that. If
// `statx` isn't available, fall back to the buggy system call.
- #[cfg(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64")))]
+ #[cfg(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ ))]
{
match crate::fs::statx(fd, cstr!(""), AtFlags::EMPTY_PATH, StatxFlags::BASIC_STATS) {
Ok(x) => statx_to_stat(x),
@@ -1282,7 +1352,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
// Main version: libc is y2038 safe. Or, the platform is not y2038 safe and
// there's nothing practical we can do.
- #[cfg(not(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64"))))]
+ #[cfg(not(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+ )))]
unsafe {
let mut stat = MaybeUninit::<Stat>::uninit();
ret(c::fstat(borrowed_fd(fd), stat.as_mut_ptr()))?;
@@ -1290,7 +1367,14 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
}
}
-#[cfg(all(linux_kernel, any(target_pointer_width = "32", target_arch = "mips64")))]
+#[cfg(all(
+ linux_kernel,
+ any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+))]
fn fstat_old(fd: BorrowedFd<'_>) -> io::Result<Stat> {
unsafe {
let mut result = MaybeUninit::<c::stat64>::uninit();
@@ -1301,8 +1385,10 @@ fn fstat_old(fd: BorrowedFd<'_>) -> io::Result<Stat> {
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -1340,44 +1426,44 @@ fn libc_statvfs_to_statvfs(from: c::statvfs) -> StatVfs {
}
}
+#[cfg(not(target_os = "espidf"))]
pub(crate) fn futimens(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> {
- // 32-bit gnu version: libc has `futimens` but it is not y2038 safe by default.
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
+ // Old 32-bit version: libc has `futimens` but it is not y2038 safe by
+ // default. But there may be a `__futimens64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_futimens) = __futimens64.get() {
let libc_times: [LibcTimespec; 2] = [
times.last_access.clone().into(),
times.last_modification.clone().into(),
];
- ret(libc_futimens(borrowed_fd(fd), libc_times.as_ptr()))
- } else {
- futimens_old(fd, times)
+ unsafe {
+ return ret(libc_futimens(borrowed_fd(fd), libc_times.as_ptr()));
+ }
}
+
+ futimens_old(fd, times)
}
// Main version: libc is y2038 safe and has `futimens`. Or, the platform
// is not y2038 safe and there's nothing practical we can do.
- #[cfg(not(any(
- apple,
- all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )
- )))]
+ #[cfg(not(any(apple, fix_y2038)))]
unsafe {
+ use crate::utils::as_ptr;
+
// Assert that `Timestamps` has the expected layout.
let _ = core::mem::transmute::<Timestamps, [c::timespec; 2]>(times.clone());
ret(c::futimens(borrowed_fd(fd), as_ptr(times).cast()))
}
- // `futimens` was introduced in macOS 10.13.
+ // Apple version: `futimens` was introduced in macOS 10.13.
#[cfg(apple)]
unsafe {
+ use crate::utils::as_ptr;
+
// ABI details.
weak! {
fn futimens(c::c_int, *const c::timespec) -> c::c_int
@@ -1413,11 +1499,8 @@ pub(crate) fn futimens(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()>
}
}
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
-unsafe fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> {
+#[cfg(fix_y2038)]
+fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> {
let old_times = [
c::timespec {
tv_sec: times
@@ -1437,7 +1520,7 @@ unsafe fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()>
},
];
- ret(c::futimens(borrowed_fd(fd), old_times.as_ptr()))
+ unsafe { ret(c::futimens(borrowed_fd(fd), old_times.as_ptr())) }
}
#[cfg(not(any(
@@ -1446,6 +1529,8 @@ unsafe fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()>
solarish,
target_os = "aix",
target_os = "dragonfly",
+ target_os = "espidf",
+ target_os = "nto",
target_os = "redox",
)))]
pub(crate) fn fallocate(
@@ -1520,6 +1605,7 @@ pub(crate) fn fsync(fd: BorrowedFd<'_>) -> io::Result<()> {
#[cfg(not(any(
apple,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -1648,7 +1734,7 @@ fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
/// Convert from a Linux `statx` value to rustix's `Stat`.
///
/// mips64' `struct stat64` in libc has private fields, and `stx_blocks`
-#[cfg(all(linux_kernel, target_arch = "mips64"))]
+#[cfg(all(linux_kernel, any(target_arch = "mips64", target_arch = "mips64r6")))]
fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
let mut result: Stat = unsafe { core::mem::zeroed() };
@@ -1720,7 +1806,7 @@ fn stat64_to_stat(s64: c::stat64) -> io::Result<Stat> {
///
/// mips64' `struct stat64` in libc has private fields, and `st_blocks` has
/// type `i64`.
-#[cfg(all(linux_kernel, target_arch = "mips64"))]
+#[cfg(all(linux_kernel, any(target_arch = "mips64", target_arch = "mips64r6")))]
fn stat64_to_stat(s64: c::stat64) -> io::Result<Stat> {
let mut result: Stat = unsafe { core::mem::zeroed() };
@@ -1962,6 +2048,22 @@ pub(crate) fn fcntl_fullfsync(fd: BorrowedFd<'_>) -> io::Result<()> {
unsafe { ret(c::fcntl(borrowed_fd(fd), c::F_FULLFSYNC)) }
}
+#[cfg(apple)]
+pub(crate) fn fcntl_nocache(fd: BorrowedFd, value: bool) -> io::Result<()> {
+ unsafe { ret(c::fcntl(borrowed_fd(fd), c::F_NOCACHE, value as c::c_int)) }
+}
+
+#[cfg(apple)]
+pub(crate) fn fcntl_global_nocache(fd: BorrowedFd, value: bool) -> io::Result<()> {
+ unsafe {
+ ret(c::fcntl(
+ borrowed_fd(fd),
+ c::F_GLOBAL_NOCACHE,
+ value as c::c_int,
+ ))
+ }
+}
+
/// Convert `times` from a `futimens`/`utimensat` argument into `setattrlist`
/// arguments.
#[cfg(apple)]
@@ -2048,30 +2150,6 @@ struct Attrlist {
forkattr: Attrgroup,
}
-#[cfg(linux_kernel)]
-pub(crate) fn mount(
- source: Option<&CStr>,
- target: &CStr,
- file_system_type: Option<&CStr>,
- flags: super::types::MountFlagsArg,
- data: Option<&CStr>,
-) -> io::Result<()> {
- unsafe {
- ret(c::mount(
- source.map_or_else(null, CStr::as_ptr),
- target.as_ptr(),
- file_system_type.map_or_else(null, CStr::as_ptr),
- flags.0,
- data.map_or_else(null, CStr::as_ptr).cast(),
- ))
- }
-}
-
-#[cfg(linux_kernel)]
-pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {
- unsafe { ret(c::umount2(target.as_ptr(), bitflags_bits!(flags))) }
-}
-
#[cfg(any(apple, linux_kernel))]
pub(crate) fn getxattr(path: &CStr, name: &CStr, value: &mut [u8]) -> io::Result<usize> {
let value_ptr = value.as_mut_ptr();
diff --git a/vendor/rustix/src/backend/libc/fs/types.rs b/vendor/rustix/src/backend/libc/fs/types.rs
index b52f0e210..955bdaa29 100644
--- a/vendor/rustix/src/backend/libc/fs/types.rs
+++ b/vendor/rustix/src/backend/libc/fs/types.rs
@@ -1,6 +1,7 @@
use crate::backend::c;
use bitflags::bitflags;
+#[cfg(not(target_os = "espidf"))]
bitflags! {
/// `*_OK` constants for use with [`accessat`].
///
@@ -22,7 +23,7 @@ bitflags! {
}
}
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
bitflags! {
/// `AT_*` constants for use with [`openat`], [`statat`], and other `*at`
/// functions.
@@ -85,67 +86,68 @@ bitflags! {
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct Mode: RawMode {
/// `S_IRWXU`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const RWXU = c::S_IRWXU as RawMode;
/// `S_IRUSR`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const RUSR = c::S_IRUSR as RawMode;
/// `S_IWUSR`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const WUSR = c::S_IWUSR as RawMode;
/// `S_IXUSR`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const XUSR = c::S_IXUSR as RawMode;
/// `S_IRWXG`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const RWXG = c::S_IRWXG as RawMode;
/// `S_IRGRP`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const RGRP = c::S_IRGRP as RawMode;
/// `S_IWGRP`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const WGRP = c::S_IWGRP as RawMode;
/// `S_IXGRP`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const XGRP = c::S_IXGRP as RawMode;
/// `S_IRWXO`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const RWXO = c::S_IRWXO as RawMode;
/// `S_IROTH`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const ROTH = c::S_IROTH as RawMode;
/// `S_IWOTH`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const WOTH = c::S_IWOTH as RawMode;
/// `S_IXOTH`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const XOTH = c::S_IXOTH as RawMode;
/// `S_ISUID`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const SUID = c::S_ISUID as RawMode;
/// `S_ISGID`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const SGID = c::S_ISGID as RawMode;
/// `S_ISVTX`
- #[cfg(not(target_os = "wasi"))] // WASI doesn't have Unix-style mode flags.
+ #[cfg(not(any(target_os = "espidf", target_os = "wasi")))] // WASI doesn't have Unix-style mode flags.
const SVTX = c::S_ISVTX as RawMode;
}
}
+#[cfg(not(target_os = "espidf"))]
impl Mode {
/// Construct a `Mode` from the mode bits of the `st_mode` field of a
/// `Stat`.
@@ -161,6 +163,7 @@ impl Mode {
}
}
+#[cfg(not(target_os = "espidf"))]
impl From<RawMode> for Mode {
/// Support conversions from raw mode values to `Mode`.
///
@@ -174,6 +177,7 @@ impl From<RawMode> for Mode {
}
}
+#[cfg(not(target_os = "espidf"))]
impl From<Mode> for RawMode {
/// Support conversions from `Mode` to raw mode values.
///
@@ -214,10 +218,11 @@ bitflags! {
const CREATE = bitcast!(c::O_CREAT);
/// `O_DIRECTORY`
+ #[cfg(not(target_os = "espidf"))]
const DIRECTORY = bitcast!(c::O_DIRECTORY);
/// `O_DSYNC`
- #[cfg(not(any(target_os = "dragonfly", target_os = "redox")))]
+ #[cfg(not(any(target_os = "dragonfly", target_os = "espidf", target_os = "l4re", target_os = "redox")))]
const DSYNC = bitcast!(c::O_DSYNC);
/// `O_EXCL`
@@ -231,6 +236,7 @@ bitflags! {
const FSYNC = bitcast!(c::O_FSYNC);
/// `O_NOFOLLOW`
+ #[cfg(not(target_os = "espidf"))]
const NOFOLLOW = bitcast!(c::O_NOFOLLOW);
/// `O_NONBLOCK`
@@ -246,7 +252,7 @@ bitflags! {
const RDWR = bitcast!(c::O_RDWR);
/// `O_NOCTTY`
- #[cfg(not(target_os = "redox"))]
+ #[cfg(not(any(target_os = "espidf", target_os = "l4re", target_os = "redox")))]
const NOCTTY = bitcast!(c::O_NOCTTY);
/// `O_RSYNC`
@@ -259,7 +265,7 @@ bitflags! {
const RSYNC = bitcast!(c::O_RSYNC);
/// `O_SYNC`
- #[cfg(not(target_os = "redox"))]
+ #[cfg(not(any(target_os = "l4re", target_os = "redox")))]
const SYNC = bitcast!(c::O_SYNC);
/// `O_TRUNC`
@@ -489,7 +495,13 @@ impl FileType {
}
/// Construct a `FileType` from the `d_type` field of a `c::dirent`.
- #[cfg(not(any(solarish, target_os = "haiku", target_os = "redox")))]
+ #[cfg(not(any(
+ solarish,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "redox"
+ )))]
#[inline]
pub(crate) const fn from_dirent_d_type(d_type: u8) -> Self {
match d_type {
@@ -516,6 +528,7 @@ impl FileType {
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -725,7 +738,14 @@ bitflags! {
}
}
-#[cfg(not(any(netbsdlike, solarish, target_os = "aix", target_os = "redox")))]
+#[cfg(not(any(
+ netbsdlike,
+ solarish,
+ target_os = "aix",
+ target_os = "espidf",
+ target_os = "nto",
+ target_os = "redox"
+)))]
bitflags! {
/// `FALLOC_FL_*` constants for use with [`fallocate`].
///
@@ -753,10 +773,11 @@ bitflags! {
#[cfg(not(any(
bsd,
target_os = "aix",
- target_os = "haiku",
- target_os = "linux",
target_os = "emscripten",
target_os = "fuchsia",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "linux",
target_os = "wasi",
)))]
const NO_HIDE_STALE = bitcast!(c::FALLOC_FL_NO_HIDE_STALE);
@@ -831,9 +852,11 @@ bitflags! {
const NOEXEC = c::ST_NOEXEC as u64;
/// `ST_NOSUID`
+ #[cfg(not(target_os = "espidf"))]
const NOSUID = c::ST_NOSUID as u64;
/// `ST_RDONLY`
+ #[cfg(not(target_os = "espidf"))]
const RDONLY = c::ST_RDONLY as u64;
/// `ST_RELATIME`
@@ -850,7 +873,7 @@ bitflags! {
///
/// [`flock`]: crate::fs::flock
/// [`fcntl_lock`]: crate::fs::fcntl_lock
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u32)]
pub enum FlockOperation {
@@ -923,8 +946,10 @@ pub struct Stat {
#[cfg(not(any(
linux_like,
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -1062,10 +1087,16 @@ pub type FsWord = u32;
pub type FsWord = u64;
/// `__fsword_t`
-// s390x uses `u32` for `statfs` entries, even though `__fsword_t` is `u64`.
-#[cfg(all(target_os = "linux", target_arch = "s390x"))]
+// s390x uses `u32` for `statfs` entries on glibc, even though `__fsword_t` is
+// `u64`.
+#[cfg(all(target_os = "linux", target_arch = "s390x", target_env = "gnu"))]
pub type FsWord = u32;
+/// `__fsword_t`
+// s390x uses `u64` for `statfs` entries on musl.
+#[cfg(all(target_os = "linux", target_arch = "s390x", target_env = "musl"))]
+pub type FsWord = u64;
+
/// `copyfile_state_t`—State for use with [`fcopyfile`].
///
/// [`fcopyfile`]: crate::fs::fcopyfile
@@ -1074,112 +1105,3 @@ pub type FsWord = u32;
#[repr(transparent)]
#[derive(Copy, Clone)]
pub struct copyfile_state_t(pub(crate) *mut c::c_void);
-
-#[cfg(linux_kernel)]
-bitflags! {
- /// `MS_*` constants for use with [`mount`].
- ///
- /// [`mount`]: crate::fs::mount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MountFlags: c::c_ulong {
- /// `MS_BIND`
- const BIND = c::MS_BIND;
-
- /// `MS_DIRSYNC`
- const DIRSYNC = c::MS_DIRSYNC;
-
- /// `MS_LAZYTIME`
- const LAZYTIME = c::MS_LAZYTIME;
-
- /// `MS_MANDLOCK`
- #[doc(alias = "MANDLOCK")]
- const PERMIT_MANDATORY_FILE_LOCKING = c::MS_MANDLOCK;
-
- /// `MS_NOATIME`
- const NOATIME = c::MS_NOATIME;
-
- /// `MS_NODEV`
- const NODEV = c::MS_NODEV;
-
- /// `MS_NODIRATIME`
- const NODIRATIME = c::MS_NODIRATIME;
-
- /// `MS_NOEXEC`
- const NOEXEC = c::MS_NOEXEC;
-
- /// `MS_NOSUID`
- const NOSUID = c::MS_NOSUID;
-
- /// `MS_RDONLY`
- const RDONLY = c::MS_RDONLY;
-
- /// `MS_REC`
- const REC = c::MS_REC;
-
- /// `MS_RELATIME`
- const RELATIME = c::MS_RELATIME;
-
- /// `MS_SILENT`
- const SILENT = c::MS_SILENT;
-
- /// `MS_STRICTATIME`
- const STRICTATIME = c::MS_STRICTATIME;
-
- /// `MS_SYNCHRONOUS`
- const SYNCHRONOUS = c::MS_SYNCHRONOUS;
- }
-}
-
-#[cfg(linux_kernel)]
-bitflags! {
- /// `MS_*` constants for use with [`change_mount`].
- ///
- /// [`change_mount`]: crate::fs::mount::change_mount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MountPropagationFlags: c::c_ulong {
- /// `MS_SHARED`
- const SHARED = c::MS_SHARED;
- /// `MS_PRIVATE`
- const PRIVATE = c::MS_PRIVATE;
- /// `MS_SLAVE`
- const SLAVE = c::MS_SLAVE;
- /// `MS_UNBINDABLE`
- const UNBINDABLE = c::MS_UNBINDABLE;
- /// `MS_REC`
- const REC = c::MS_REC;
- }
-}
-
-#[cfg(linux_kernel)]
-bitflags! {
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub(crate) struct InternalMountFlags: c::c_ulong {
- const REMOUNT = c::MS_REMOUNT;
- const MOVE = c::MS_MOVE;
- }
-}
-
-#[cfg(linux_kernel)]
-pub(crate) struct MountFlagsArg(pub(crate) c::c_ulong);
-
-#[cfg(linux_kernel)]
-bitflags! {
- /// `MNT_*` constants for use with [`unmount`].
- ///
- /// [`unmount`]: crate::fs::mount::unmount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct UnmountFlags: u32 {
- /// `MNT_FORCE`
- const FORCE = bitcast!(c::MNT_FORCE);
- /// `MNT_DETACH`
- const DETACH = bitcast!(c::MNT_DETACH);
- /// `MNT_EXPIRE`
- const EXPIRE = bitcast!(c::MNT_EXPIRE);
- /// `UMOUNT_NOFOLLOW`
- const NOFOLLOW = bitcast!(c::UMOUNT_NOFOLLOW);
- }
-}
diff --git a/vendor/rustix/src/backend/libc/io/errno.rs b/vendor/rustix/src/backend/libc/io/errno.rs
index 71fba49e9..aabd45f8c 100644
--- a/vendor/rustix/src/backend/libc/io/errno.rs
+++ b/vendor/rustix/src/backend/libc/io/errno.rs
@@ -28,15 +28,19 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const ADV: Self = Self(c::EADV);
/// `EAFNOSUPPORT`
+ #[cfg(not(target_os = "l4re"))]
pub const AFNOSUPPORT: Self = Self(c::EAFNOSUPPORT);
/// `EAGAIN`
pub const AGAIN: Self = Self(c::EAGAIN);
/// `EALREADY`
+ #[cfg(not(target_os = "l4re"))]
pub const ALREADY: Self = Self(c::EALREADY);
/// `EAUTH`
#[cfg(bsd)]
@@ -46,7 +50,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const BADE: Self = Self(c::EBADE);
@@ -57,19 +63,23 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const BADFD: Self = Self(c::EBADFD);
/// `EBADMSG`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const BADMSG: Self = Self(c::EBADMSG);
/// `EBADR`
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const BADR: Self = Self(c::EBADR);
@@ -81,7 +91,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const BADRQC: Self = Self(c::EBADRQC);
@@ -90,7 +102,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const BADSLT: Self = Self(c::EBADSLT);
@@ -99,7 +113,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const BFONT: Self = Self(c::EBFONT);
@@ -107,6 +123,7 @@ impl Errno {
#[cfg(not(windows))]
pub const BUSY: Self = Self(c::EBUSY);
/// `ECANCELED`
+ #[cfg(not(target_os = "l4re"))]
pub const CANCELED: Self = Self(c::ECANCELED);
/// `ECAPMODE`
#[cfg(target_os = "freebsd")]
@@ -115,14 +132,23 @@ impl Errno {
#[cfg(not(windows))]
pub const CHILD: Self = Self(c::ECHILD);
/// `ECHRNG`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const CHRNG: Self = Self(c::ECHRNG);
/// `ECOMM`
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const COMM: Self = Self(c::ECOMM);
@@ -141,11 +167,13 @@ impl Errno {
windows,
target_os = "aix",
target_os = "android",
+ target_os = "espidf",
target_os = "haiku",
target_os = "wasi",
)))]
pub const DEADLOCK: Self = Self(c::EDEADLOCK);
/// `EDESTADDRREQ`
+ #[cfg(not(target_os = "l4re"))]
pub const DESTADDRREQ: Self = Self(c::EDESTADDRREQ);
/// `EDISCON`
#[cfg(windows)]
@@ -162,7 +190,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const DOTDOT: Self = Self(c::EDOTDOT);
@@ -180,7 +211,7 @@ impl Errno {
#[cfg(any(bsd, target_env = "newlib"))]
pub const FTYPE: Self = Self(c::EFTYPE);
/// `EHOSTDOWN`
- #[cfg(not(target_os = "wasi"))]
+ #[cfg(not(any(target_os = "l4re", target_os = "wasi")))]
pub const HOSTDOWN: Self = Self(c::EHOSTDOWN);
/// `EHOSTUNREACH`
pub const HOSTUNREACH: Self = Self(c::EHOSTUNREACH);
@@ -191,18 +222,22 @@ impl Errno {
windows,
target_os = "aix",
target_os = "android",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
pub const HWPOISON: Self = Self(c::EHWPOISON);
/// `EIDRM`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const IDRM: Self = Self(c::EIDRM);
/// `EILSEQ`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const ILSEQ: Self = Self(c::EILSEQ);
/// `EINPROGRESS`
+ #[cfg(not(target_os = "l4re"))]
pub const INPROGRESS: Self = Self(c::EINPROGRESS);
/// `EINTR`
///
@@ -223,6 +258,7 @@ impl Errno {
#[cfg(not(windows))]
pub const IO: Self = Self(c::EIO);
/// `EISCONN`
+ #[cfg(not(target_os = "l4re"))]
pub const ISCONN: Self = Self(c::EISCONN);
/// `EISDIR`
#[cfg(not(windows))]
@@ -233,7 +269,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const ISNAM: Self = Self(c::EISNAM);
@@ -243,7 +282,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const KEYEXPIRED: Self = Self(c::EKEYEXPIRED);
@@ -253,7 +295,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const KEYREJECTED: Self = Self(c::EKEYREJECTED);
@@ -263,28 +308,61 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const KEYREVOKED: Self = Self(c::EKEYREVOKED);
/// `EL2HLT`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const L2HLT: Self = Self(c::EL2HLT);
/// `EL2NSYNC`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const L2NSYNC: Self = Self(c::EL2NSYNC);
/// `EL3HLT`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const L3HLT: Self = Self(c::EL3HLT);
/// `EL3RST`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const L3RST: Self = Self(c::EL3RST);
/// `ELIBACC`
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const LIBACC: Self = Self(c::ELIBACC);
@@ -293,7 +371,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const LIBBAD: Self = Self(c::ELIBBAD);
@@ -302,7 +382,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const LIBEXEC: Self = Self(c::ELIBEXEC);
@@ -311,7 +393,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const LIBMAX: Self = Self(c::ELIBMAX);
@@ -320,12 +404,21 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const LIBSCN: Self = Self(c::ELIBSCN);
/// `ELNRNG`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const LNRNG: Self = Self(c::ELNRNG);
/// `ELOOP`
pub const LOOP: Self = Self(c::ELOOP);
@@ -335,7 +428,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const MEDIUMTYPE: Self = Self(c::EMEDIUMTYPE);
@@ -345,9 +441,10 @@ impl Errno {
#[cfg(not(windows))]
pub const MLINK: Self = Self(c::EMLINK);
/// `EMSGSIZE`
+ #[cfg(not(target_os = "l4re"))]
pub const MSGSIZE: Self = Self(c::EMSGSIZE);
/// `EMULTIHOP`
- #[cfg(not(any(windows, target_os = "openbsd")))]
+ #[cfg(not(any(windows, target_os = "l4re", target_os = "openbsd")))]
pub const MULTIHOP: Self = Self(c::EMULTIHOP);
/// `ENAMETOOLONG`
pub const NAMETOOLONG: Self = Self(c::ENAMETOOLONG);
@@ -357,7 +454,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const NAVAIL: Self = Self(c::ENAVAIL);
@@ -367,6 +467,7 @@ impl Errno {
/// `ENETDOWN`
pub const NETDOWN: Self = Self(c::ENETDOWN);
/// `ENETRESET`
+ #[cfg(not(target_os = "l4re"))]
pub const NETRESET: Self = Self(c::ENETRESET);
/// `ENETUNREACH`
pub const NETUNREACH: Self = Self(c::ENETUNREACH);
@@ -378,7 +479,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const NOANO: Self = Self(c::ENOANO);
@@ -386,9 +489,17 @@ impl Errno {
#[cfg(any(bsd, target_os = "haiku"))]
pub const NOATTR: Self = Self(c::ENOATTR);
/// `ENOBUFS`
+ #[cfg(not(target_os = "l4re"))]
pub const NOBUFS: Self = Self(c::ENOBUFS);
/// `ENOCSI`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const NOCSI: Self = Self(c::ENOCSI);
/// `ENODATA`
#[cfg(not(any(
@@ -414,15 +525,18 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const NOKEY: Self = Self(c::ENOKEY);
/// `ENOLCK`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const NOLCK: Self = Self(c::ENOLCK);
/// `ENOLINK`
- #[cfg(not(any(windows, target_os = "openbsd")))]
+ #[cfg(not(any(windows, target_os = "l4re", target_os = "openbsd")))]
pub const NOLINK: Self = Self(c::ENOLINK);
/// `ENOMEDIUM`
#[cfg(not(any(
@@ -430,7 +544,10 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const NOMEDIUM: Self = Self(c::ENOMEDIUM);
@@ -441,14 +558,16 @@ impl Errno {
#[cfg(windows)]
pub const NOMORE: Self = Self(c::ENOMORE);
/// `ENOMSG`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const NOMSG: Self = Self(c::ENOMSG);
/// `ENONET`
#[cfg(not(any(
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const NONET: Self = Self(c::ENONET);
@@ -457,11 +576,14 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const NOPKG: Self = Self(c::ENOPKG);
/// `ENOPROTOOPT`
+ #[cfg(not(target_os = "l4re"))]
pub const NOPROTOOPT: Self = Self(c::ENOPROTOOPT);
/// `ENOSPC`
#[cfg(not(windows))]
@@ -471,6 +593,7 @@ impl Errno {
freebsdlike,
windows,
target_os = "haiku",
+ target_os = "l4re",
target_os = "openbsd",
target_os = "wasi",
)))]
@@ -480,6 +603,7 @@ impl Errno {
freebsdlike,
windows,
target_os = "haiku",
+ target_os = "l4re",
target_os = "openbsd",
target_os = "wasi",
)))]
@@ -488,7 +612,7 @@ impl Errno {
#[cfg(not(windows))]
pub const NOSYS: Self = Self(c::ENOSYS);
/// `ENOTBLK`
- #[cfg(not(any(windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(windows, target_os = "espidf", target_os = "haiku", target_os = "wasi")))]
pub const NOTBLK: Self = Self(c::ENOTBLK);
/// `ENOTCAPABLE`
#[cfg(any(target_os = "freebsd", target_os = "wasi"))]
@@ -506,14 +630,24 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const NOTNAM: Self = Self(c::ENOTNAM);
/// `ENOTRECOVERABLE`
- #[cfg(not(any(freebsdlike, netbsdlike, windows, target_os = "haiku")))]
+ #[cfg(not(any(
+ freebsdlike,
+ netbsdlike,
+ windows,
+ target_os = "haiku",
+ target_os = "l4re"
+ )))]
pub const NOTRECOVERABLE: Self = Self(c::ENOTRECOVERABLE);
/// `ENOTSOCK`
+ #[cfg(not(target_os = "l4re"))]
pub const NOTSOCK: Self = Self(c::ENOTSOCK);
/// `ENOTSUP`
#[cfg(not(any(windows, target_os = "haiku", target_os = "redox")))]
@@ -526,7 +660,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const NOTUNIQ: Self = Self(c::ENOTUNIQ);
@@ -536,16 +672,22 @@ impl Errno {
/// `EOPNOTSUPP`
pub const OPNOTSUPP: Self = Self(c::EOPNOTSUPP);
/// `EOVERFLOW`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const OVERFLOW: Self = Self(c::EOVERFLOW);
/// `EOWNERDEAD`
- #[cfg(not(any(freebsdlike, netbsdlike, windows, target_os = "haiku")))]
+ #[cfg(not(any(
+ freebsdlike,
+ netbsdlike,
+ windows,
+ target_os = "haiku",
+ target_os = "l4re"
+ )))]
pub const OWNERDEAD: Self = Self(c::EOWNERDEAD);
/// `EPERM`
#[cfg(not(windows))]
pub const PERM: Self = Self(c::EPERM);
/// `EPFNOSUPPORT`
- #[cfg(not(target_os = "wasi"))]
+ #[cfg(not(any(target_os = "l4re", target_os = "wasi")))]
pub const PFNOSUPPORT: Self = Self(c::EPFNOSUPPORT);
/// `EPIPE`
#[cfg(not(windows))]
@@ -563,11 +705,13 @@ impl Errno {
#[cfg(bsd)]
pub const PROGUNAVAIL: Self = Self(c::EPROGUNAVAIL);
/// `EPROTO`
- #[cfg(not(windows))]
+ #[cfg(not(any(windows, target_os = "l4re")))]
pub const PROTO: Self = Self(c::EPROTO);
/// `EPROTONOSUPPORT`
+ #[cfg(not(target_os = "l4re"))]
pub const PROTONOSUPPORT: Self = Self(c::EPROTONOSUPPORT);
/// `EPROTOTYPE`
+ #[cfg(not(target_os = "l4re"))]
pub const PROTOTYPE: Self = Self(c::EPROTOTYPE);
/// `EPROVIDERFAILEDINIT`
#[cfg(windows)]
@@ -583,12 +727,19 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const REMCHG: Self = Self(c::EREMCHG);
/// `EREMOTE`
- #[cfg(not(any(target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const REMOTE: Self = Self(c::EREMOTE);
/// `EREMOTEIO`
#[cfg(not(any(
@@ -596,12 +747,22 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const REMOTEIO: Self = Self(c::EREMOTEIO);
/// `ERESTART`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const RESTART: Self = Self(c::ERESTART);
/// `ERFKILL`
#[cfg(not(any(
@@ -610,7 +771,10 @@ impl Errno {
windows,
target_os = "aix",
target_os = "android",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -622,10 +786,15 @@ impl Errno {
#[cfg(bsd)]
pub const RPCMISMATCH: Self = Self(c::ERPCMISMATCH);
/// `ESHUTDOWN`
- #[cfg(not(target_os = "wasi"))]
+ #[cfg(not(any(target_os = "espidf", target_os = "l4re", target_os = "wasi")))]
pub const SHUTDOWN: Self = Self(c::ESHUTDOWN);
/// `ESOCKTNOSUPPORT`
- #[cfg(not(any(target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const SOCKTNOSUPPORT: Self = Self(c::ESOCKTNOSUPPORT);
/// `ESPIPE`
#[cfg(not(windows))]
@@ -638,7 +807,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const SRMNT: Self = Self(c::ESRMNT);
@@ -649,12 +820,20 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const STRPIPE: Self = Self(c::ESTRPIPE);
/// `ETIME`
- #[cfg(not(any(freebsdlike, windows, target_os = "openbsd", target_os = "wasi")))]
+ #[cfg(not(any(
+ freebsdlike,
+ windows,
+ target_os = "l4re",
+ target_os = "openbsd",
+ target_os = "wasi"
+ )))]
pub const TIME: Self = Self(c::ETIME);
/// `ETIMEDOUT`
pub const TIMEDOUT: Self = Self(c::ETIMEDOUT);
@@ -663,7 +842,7 @@ impl Errno {
#[doc(alias = "2BIG")]
pub const TOOBIG: Self = Self(c::E2BIG);
/// `ETOOMANYREFS`
- #[cfg(not(any(target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(target_os = "haiku", target_os = "l4re", target_os = "wasi")))]
pub const TOOMANYREFS: Self = Self(c::ETOOMANYREFS);
/// `ETXTBSY`
#[cfg(not(windows))]
@@ -674,15 +853,30 @@ impl Errno {
solarish,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto",
target_os = "wasi",
)))]
pub const UCLEAN: Self = Self(c::EUCLEAN);
/// `EUNATCH`
- #[cfg(not(any(bsd, windows, target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ bsd,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const UNATCH: Self = Self(c::EUNATCH);
/// `EUSERS`
- #[cfg(not(any(target_os = "haiku", target_os = "wasi")))]
+ #[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "wasi"
+ )))]
pub const USERS: Self = Self(c::EUSERS);
/// `EWOULDBLOCK`
pub const WOULDBLOCK: Self = Self(c::EWOULDBLOCK);
@@ -694,7 +888,9 @@ impl Errno {
bsd,
windows,
target_os = "aix",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "l4re",
target_os = "wasi",
)))]
pub const XFULL: Self = Self(c::EXFULL);
diff --git a/vendor/rustix/src/backend/libc/io/syscalls.rs b/vendor/rustix/src/backend/libc/io/syscalls.rs
index 6ac1fa593..362af11ee 100644
--- a/vendor/rustix/src/backend/libc/io/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/io/syscalls.rs
@@ -1,19 +1,28 @@
//! libc syscalls supporting `rustix::io`.
-use crate::backend::conv::{
- borrowed_fd, ret, ret_c_int, ret_discarded_fd, ret_owned_fd, ret_usize,
-};
-use crate::backend::{c, MAX_IOV};
+use crate::backend::c;
+#[cfg(not(target_os = "wasi"))]
+use crate::backend::conv::ret_discarded_fd;
+use crate::backend::conv::{borrowed_fd, ret, ret_c_int, ret_owned_fd, ret_usize};
use crate::fd::{AsFd, BorrowedFd, OwnedFd, RawFd};
-#[cfg(not(any(target_os = "aix", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "aix",
+ target_os = "espidf",
+ target_os = "nto",
+ target_os = "wasi"
+)))]
use crate::io::DupFlags;
#[cfg(linux_kernel)]
use crate::io::ReadWriteFlags;
-use crate::io::{self, FdFlags, IoSlice, IoSliceMut};
+use crate::io::{self, FdFlags};
use core::cmp::min;
-use core::mem::MaybeUninit;
#[cfg(all(feature = "fs", feature = "net"))]
use libc_errno::errno;
+#[cfg(not(target_os = "espidf"))]
+use {
+ crate::backend::MAX_IOV,
+ crate::io::{IoSlice, IoSliceMut},
+};
pub(crate) fn read(fd: BorrowedFd<'_>, buf: &mut [u8]) -> io::Result<usize> {
unsafe {
@@ -41,6 +50,10 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], offset: u64) -> io::Resu
// Silently cast; we'll get `EINVAL` if the value is negative.
let offset = offset as i64;
+ // ESP-IDF doesn't support 64-bit offsets.
+ #[cfg(target_os = "espidf")]
+ let offset: i32 = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?;
+
unsafe {
ret_usize(c::pread(
borrowed_fd(fd),
@@ -57,9 +70,14 @@ pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], offset: u64) -> io::Result<
// Silently cast; we'll get `EINVAL` if the value is negative.
let offset = offset as i64;
+ // ESP-IDF doesn't support 64-bit offsets.
+ #[cfg(target_os = "espidf")]
+ let offset: i32 = offset.try_into().map_err(|_| io::Errno::OVERFLOW)?;
+
unsafe { ret_usize(c::pwrite(borrowed_fd(fd), buf.as_ptr().cast(), len, offset)) }
}
+#[cfg(not(target_os = "espidf"))]
pub(crate) fn readv(fd: BorrowedFd<'_>, bufs: &mut [IoSliceMut]) -> io::Result<usize> {
unsafe {
ret_usize(c::readv(
@@ -70,6 +88,7 @@ pub(crate) fn readv(fd: BorrowedFd<'_>, bufs: &mut [IoSliceMut]) -> io::Result<u
}
}
+#[cfg(not(target_os = "espidf"))]
pub(crate) fn writev(fd: BorrowedFd<'_>, bufs: &[IoSlice]) -> io::Result<usize> {
unsafe {
ret_usize(c::writev(
@@ -80,7 +99,13 @@ pub(crate) fn writev(fd: BorrowedFd<'_>, bufs: &[IoSlice]) -> io::Result<usize>
}
}
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "solaris")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "redox",
+ target_os = "solaris"
+)))]
pub(crate) fn preadv(
fd: BorrowedFd<'_>,
bufs: &mut [IoSliceMut],
@@ -98,7 +123,13 @@ pub(crate) fn preadv(
}
}
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "solaris")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "redox",
+ target_os = "solaris"
+)))]
pub(crate) fn pwritev(fd: BorrowedFd<'_>, bufs: &[IoSlice], offset: u64) -> io::Result<usize> {
// Silently cast; we'll get `EINVAL` if the value is negative.
let offset = offset as i64;
@@ -172,7 +203,10 @@ pub(crate) unsafe fn close(raw_fd: RawFd) {
let _ = c::close(raw_fd as c::c_int);
}
+#[cfg(not(target_os = "espidf"))]
pub(crate) fn ioctl_fionread(fd: BorrowedFd<'_>) -> io::Result<u64> {
+ use core::mem::MaybeUninit;
+
let mut nread = MaybeUninit::<c::c_int>::uninit();
unsafe {
ret(c::ioctl(borrowed_fd(fd), c::FIONREAD, nread.as_mut_ptr()))?;
@@ -193,6 +227,8 @@ pub(crate) fn ioctl_fionbio(fd: BorrowedFd<'_>, value: bool) -> io::Result<()> {
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[cfg(all(feature = "fs", feature = "net"))]
pub(crate) fn is_read_write(fd: BorrowedFd<'_>) -> io::Result<(bool, bool)> {
+ use core::mem::MaybeUninit;
+
let (mut read, mut write) = crate::fs::fd::_is_file_read_write(fd)?;
let mut not_socket = false;
if read {
@@ -251,11 +287,16 @@ pub(crate) fn fcntl_setfd(fd: BorrowedFd<'_>, flags: FdFlags) -> io::Result<()>
unsafe { ret(c::fcntl(borrowed_fd(fd), c::F_SETFD, flags.bits())) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn fcntl_dupfd_cloexec(fd: BorrowedFd<'_>, min: RawFd) -> io::Result<OwnedFd> {
unsafe { ret_owned_fd(c::fcntl(borrowed_fd(fd), c::F_DUPFD_CLOEXEC, min)) }
}
+#[cfg(target_os = "espidf")]
+pub(crate) fn fcntl_dupfd(fd: BorrowedFd<'_>, min: RawFd) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(c::fcntl(borrowed_fd(fd), c::F_DUPFD, min)) }
+}
+
#[cfg(not(target_os = "wasi"))]
pub(crate) fn dup(fd: BorrowedFd<'_>) -> io::Result<OwnedFd> {
unsafe { ret_owned_fd(c::dup(borrowed_fd(fd))) }
@@ -271,7 +312,9 @@ pub(crate) fn dup2(fd: BorrowedFd<'_>, new: &mut OwnedFd) -> io::Result<()> {
target_os = "aix",
target_os = "android",
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
diff --git a/vendor/rustix/src/backend/libc/mm/types.rs b/vendor/rustix/src/backend/libc/mm/types.rs
index e4fecfccd..6a41cbe56 100644
--- a/vendor/rustix/src/backend/libc/mm/types.rs
+++ b/vendor/rustix/src/backend/libc/mm/types.rs
@@ -40,6 +40,21 @@ bitflags! {
/// `PROT_GROWSDOWN`
#[cfg(linux_kernel)]
const GROWSDOWN = bitcast!(c::PROT_GROWSDOWN);
+ /// `PROT_SEM`
+ #[cfg(linux_kernel)]
+ const SEM = linux_raw_sys::general::PROT_SEM;
+ /// `PROT_BTI`
+ #[cfg(all(linux_kernel, target_arch = "aarch64"))]
+ const BTI = linux_raw_sys::general::PROT_BTI;
+ /// `PROT_MTE`
+ #[cfg(all(linux_kernel, target_arch = "aarch64"))]
+ const MTE = linux_raw_sys::general::PROT_MTE;
+ /// `PROT_SAO`
+ #[cfg(all(linux_kernel, any(target_arch = "powerpc", target_arch = "powerpc64")))]
+ const SAO = linux_raw_sys::general::PROT_SAO;
+ /// `PROT_ADI`
+ #[cfg(all(linux_kernel, any(target_arch = "sparc", target_arch = "sparc64")))]
+ const ADI = linux_raw_sys::general::PROT_ADI;
}
}
@@ -63,6 +78,7 @@ bitflags! {
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const SHARED_VALIDATE = bitcast!(c::MAP_SHARED_VALIDATE);
@@ -73,6 +89,7 @@ bitflags! {
bsd,
solarish,
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const DENYWRITE = bitcast!(c::MAP_DENYWRITE);
@@ -86,6 +103,7 @@ bitflags! {
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const FIXED_NOREPLACE = bitcast!(c::MAP_FIXED_NOREPLACE);
@@ -94,6 +112,7 @@ bitflags! {
bsd,
solarish,
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const GROWSDOWN = bitcast!(c::MAP_GROWSDOWN);
@@ -102,6 +121,7 @@ bitflags! {
bsd,
solarish,
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const HUGETLB = bitcast!(c::MAP_HUGETLB);
@@ -113,6 +133,7 @@ bitflags! {
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const HUGE_2MB = bitcast!(c::MAP_HUGE_2MB);
@@ -124,6 +145,7 @@ bitflags! {
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const HUGE_1GB = bitcast!(c::MAP_HUGE_1GB);
@@ -132,6 +154,7 @@ bitflags! {
bsd,
solarish,
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const LOCKED = bitcast!(c::MAP_LOCKED);
@@ -139,7 +162,7 @@ bitflags! {
#[cfg(freebsdlike)]
const NOCORE = bitcast!(c::MAP_NOCORE);
/// `MAP_NORESERVE`
- #[cfg(not(any(freebsdlike, target_os = "redox")))]
+ #[cfg(not(any(freebsdlike, target_os = "nto", target_os = "redox")))]
const NORESERVE = bitcast!(c::MAP_NORESERVE);
/// `MAP_NOSYNC`
#[cfg(freebsdlike)]
@@ -149,6 +172,7 @@ bitflags! {
bsd,
solarish,
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const POPULATE = bitcast!(c::MAP_POPULATE);
@@ -173,10 +197,11 @@ bitflags! {
target_os = "emscripten",
target_os = "fuchsia",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
all(
linux_kernel,
- any(target_arch = "mips", target_arch = "mips64"),
+ any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6"),
)
)))]
const SYNC = bitcast!(c::MAP_SYNC);
@@ -308,7 +333,15 @@ pub enum Advice {
#[cfg(linux_kernel)]
LinuxHwPoison = bitcast!(c::MADV_HWPOISON),
/// `MADV_SOFT_OFFLINE`
- #[cfg(all(linux_kernel, not(any(target_arch = "mips", target_arch = "mips64"))))]
+ #[cfg(all(
+ linux_kernel,
+ not(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))
+ ))]
LinuxSoftOffline = bitcast!(c::MADV_SOFT_OFFLINE),
/// `MADV_MERGEABLE`
#[cfg(linux_kernel)]
diff --git a/vendor/rustix/src/backend/libc/mod.rs b/vendor/rustix/src/backend/libc/mod.rs
index 357f99484..59fc3bea1 100644
--- a/vendor/rustix/src/backend/libc/mod.rs
+++ b/vendor/rustix/src/backend/libc/mod.rs
@@ -111,13 +111,19 @@ pub(crate) mod io;
#[cfg(linux_kernel)]
#[cfg(feature = "io_uring")]
pub(crate) mod io_uring;
-#[cfg(not(any(windows, target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[cfg(feature = "mm")]
pub(crate) mod mm;
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) mod mount;
+#[cfg(linux_kernel)]
+#[cfg(all(feature = "fs", not(feature = "mount")))]
+pub(crate) mod mount; // for deprecated mount functions in "fs"
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[cfg(feature = "net")]
pub(crate) mod net;
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(any(
feature = "param",
feature = "runtime",
@@ -148,7 +154,7 @@ pub(crate) mod termios;
#[cfg(not(windows))]
#[cfg(feature = "thread")]
pub(crate) mod thread;
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(feature = "time")]
pub(crate) mod time;
@@ -193,6 +199,7 @@ const MAX_IOV: usize = c::UIO_MAXIOV as usize;
linux_kernel,
windows,
target_os = "emscripten",
+ target_os = "espidf",
target_os = "nto",
target_os = "horizon",
)))]
diff --git a/vendor/rustix/src/backend/libc/mount/mod.rs b/vendor/rustix/src/backend/libc/mount/mod.rs
new file mode 100644
index 000000000..1e0181a99
--- /dev/null
+++ b/vendor/rustix/src/backend/libc/mount/mod.rs
@@ -0,0 +1,2 @@
+pub(crate) mod syscalls;
+pub(crate) mod types;
diff --git a/vendor/rustix/src/backend/libc/mount/syscalls.rs b/vendor/rustix/src/backend/libc/mount/syscalls.rs
new file mode 100644
index 000000000..26cdb52dc
--- /dev/null
+++ b/vendor/rustix/src/backend/libc/mount/syscalls.rs
@@ -0,0 +1,272 @@
+use crate::backend::c;
+use crate::backend::conv::ret;
+#[cfg(feature = "mount")]
+use crate::backend::conv::{borrowed_fd, c_str, ret_owned_fd};
+#[cfg(feature = "mount")]
+use crate::fd::{BorrowedFd, OwnedFd};
+use crate::ffi::CStr;
+use crate::io;
+use core::ptr::null;
+
+#[cfg(linux_kernel)]
+pub(crate) fn mount(
+ source: Option<&CStr>,
+ target: &CStr,
+ file_system_type: Option<&CStr>,
+ flags: super::types::MountFlagsArg,
+ data: Option<&CStr>,
+) -> io::Result<()> {
+ unsafe {
+ ret(c::mount(
+ source.map_or_else(null, CStr::as_ptr),
+ target.as_ptr(),
+ file_system_type.map_or_else(null, CStr::as_ptr),
+ flags.0,
+ data.map_or_else(null, CStr::as_ptr).cast(),
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {
+ unsafe { ret(c::umount2(target.as_ptr(), bitflags_bits!(flags))) }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsopen(fs_name: &CStr, flags: super::types::FsOpenFlags) -> io::Result<OwnedFd> {
+ syscall! {
+ fn fsopen(
+ fs_name: *const c::c_char,
+ flags: c::c_uint
+ ) via SYS_fsopen -> c::c_int
+ }
+ unsafe { ret_owned_fd(fsopen(c_str(fs_name), flags.bits())) }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsmount(
+ fs_fd: BorrowedFd<'_>,
+ flags: super::types::FsMountFlags,
+ attr_flags: super::types::MountAttrFlags,
+) -> io::Result<()> {
+ syscall! {
+ fn fsmount(
+ fs_fd: c::c_int,
+ flags: c::c_uint,
+ attr_flags: c::c_uint
+ ) via SYS_fsmount -> c::c_int
+ }
+ unsafe { ret(fsmount(borrowed_fd(fs_fd), flags.bits(), attr_flags.bits())) }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn move_mount(
+ from_dfd: BorrowedFd<'_>,
+ from_pathname: &CStr,
+ to_dfd: BorrowedFd<'_>,
+ to_pathname: &CStr,
+ flags: super::types::MoveMountFlags,
+) -> io::Result<()> {
+ syscall! {
+ fn move_mount(
+ from_dfd: c::c_int,
+ from_pathname: *const c::c_char,
+ to_dfd: c::c_int,
+ to_pathname: *const c::c_char,
+ flags: c::c_uint
+ ) via SYS_move_mount -> c::c_int
+ }
+ unsafe {
+ ret(move_mount(
+ borrowed_fd(from_dfd),
+ c_str(from_pathname),
+ borrowed_fd(to_dfd),
+ c_str(to_pathname),
+ flags.bits(),
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn open_tree(
+ dfd: BorrowedFd<'_>,
+ filename: &CStr,
+ flags: super::types::OpenTreeFlags,
+) -> io::Result<OwnedFd> {
+ syscall! {
+ fn open_tree(
+ dfd: c::c_int,
+ filename: *const c::c_char,
+ flags: c::c_uint
+ ) via SYS_open_tree -> c::c_int
+ }
+
+ unsafe { ret_owned_fd(open_tree(borrowed_fd(dfd), c_str(filename), flags.bits())) }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fspick(
+ dfd: BorrowedFd<'_>,
+ path: &CStr,
+ flags: super::types::FsPickFlags,
+) -> io::Result<OwnedFd> {
+ syscall! {
+ fn fspick(
+ dfd: c::c_int,
+ path: *const c::c_char,
+ flags: c::c_uint
+ ) via SYS_fspick -> c::c_int
+ }
+
+ unsafe { ret_owned_fd(fspick(borrowed_fd(dfd), c_str(path), flags.bits())) }
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+syscall! {
+ fn fsconfig(
+ fs_fd: c::c_int,
+ cmd: c::c_uint,
+ key: *const c::c_char,
+ val: *const c::c_char,
+ aux: c::c_int
+ ) via SYS_fsconfig -> c::c_int
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_set_flag(fs_fd: BorrowedFd<'_>, key: &CStr) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::SetFlag as _,
+ c_str(key),
+ null(),
+ 0,
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_set_string(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ value: &CStr,
+) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::SetString as _,
+ c_str(key),
+ c_str(value),
+ 0,
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_set_binary(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ value: &[u8],
+) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::SetBinary as _,
+ c_str(key),
+ value.as_ptr().cast(),
+ value.len().try_into().map_err(|_| io::Errno::OVERFLOW)?,
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_set_fd(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::SetFd as _,
+ c_str(key),
+ null(),
+ borrowed_fd(fd),
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_set_path(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ path: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::SetPath as _,
+ c_str(key),
+ c_str(path),
+ borrowed_fd(fd),
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_set_path_empty(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::SetPathEmpty as _,
+ c_str(key),
+ c_str(cstr!("")),
+ borrowed_fd(fd),
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_create(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::Create as _,
+ null(),
+ null(),
+ 0,
+ ))
+ }
+}
+
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+pub(crate) fn fsconfig_reconfigure(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ unsafe {
+ ret(fsconfig(
+ borrowed_fd(fs_fd),
+ super::types::FsConfigCmd::Reconfigure as _,
+ null(),
+ null(),
+ 0,
+ ))
+ }
+}
diff --git a/vendor/rustix/src/backend/libc/mount/types.rs b/vendor/rustix/src/backend/libc/mount/types.rs
new file mode 100644
index 000000000..660e6ae37
--- /dev/null
+++ b/vendor/rustix/src/backend/libc/mount/types.rs
@@ -0,0 +1,311 @@
+use crate::backend::c;
+use bitflags::bitflags;
+
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `MS_*` constants for use with [`mount`].
+ ///
+ /// [`mount`]: crate::mount::mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountFlags: c::c_ulong {
+ /// `MS_BIND`
+ const BIND = c::MS_BIND;
+
+ /// `MS_DIRSYNC`
+ const DIRSYNC = c::MS_DIRSYNC;
+
+ /// `MS_LAZYTIME`
+ const LAZYTIME = c::MS_LAZYTIME;
+
+ /// `MS_MANDLOCK`
+ #[doc(alias = "MANDLOCK")]
+ const PERMIT_MANDATORY_FILE_LOCKING = c::MS_MANDLOCK;
+
+ /// `MS_NOATIME`
+ const NOATIME = c::MS_NOATIME;
+
+ /// `MS_NODEV`
+ const NODEV = c::MS_NODEV;
+
+ /// `MS_NODIRATIME`
+ const NODIRATIME = c::MS_NODIRATIME;
+
+ /// `MS_NOEXEC`
+ const NOEXEC = c::MS_NOEXEC;
+
+ /// `MS_NOSUID`
+ const NOSUID = c::MS_NOSUID;
+
+ /// `MS_RDONLY`
+ const RDONLY = c::MS_RDONLY;
+
+ /// `MS_REC`
+ const REC = c::MS_REC;
+
+ /// `MS_RELATIME`
+ const RELATIME = c::MS_RELATIME;
+
+ /// `MS_SILENT`
+ const SILENT = c::MS_SILENT;
+
+ /// `MS_STRICTATIME`
+ const STRICTATIME = c::MS_STRICTATIME;
+
+ /// `MS_SYNCHRONOUS`
+ const SYNCHRONOUS = c::MS_SYNCHRONOUS;
+ }
+}
+
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `MNT_*` constants for use with [`unmount`].
+ ///
+ /// [`unmount`]: crate::mount::unmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct UnmountFlags: u32 {
+ /// `MNT_FORCE`
+ const FORCE = bitcast!(c::MNT_FORCE);
+ /// `MNT_DETACH`
+ const DETACH = bitcast!(c::MNT_DETACH);
+ /// `MNT_EXPIRE`
+ const EXPIRE = bitcast!(c::MNT_EXPIRE);
+ /// `UMOUNT_NOFOLLOW`
+ const NOFOLLOW = bitcast!(c::UMOUNT_NOFOLLOW);
+ }
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `FSOPEN_*` constants for use with [`fsopen`].
+ ///
+ /// [`fsopen`]: crate::mount::fsopen
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsOpenFlags: c::c_uint {
+
+ /// `FSOPEN_CLOEXEC`
+ const FSOPEN_CLOEXEC = 0x00000001;
+ }
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `FSMOUNT_*` constants for use with [`fsmount`].
+ ///
+ /// [`fsmount`]: crate::mount::fsmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsMountFlags: c::c_uint {
+ /// `FSMOUNT_CLOEXEC`
+ const FSMOUNT_CLOEXEC = 0x00000001;
+ }
+}
+
+/// `FSCONFIG_*` constants for use with the `fsconfig` syscall.
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+#[repr(u32)]
+pub(crate) enum FsConfigCmd {
+ /// `FSCONFIG_SET_FLAG`
+ SetFlag = 0,
+
+ /// `FSCONFIG_SET_STRING`
+ SetString = 1,
+
+ /// `FSCONFIG_SET_BINARY`
+ SetBinary = 2,
+
+ /// `FSCONFIG_SET_PATH`
+ SetPath = 3,
+
+ /// `FSCONFIG_SET_PATH_EMPTY`
+ SetPathEmpty = 4,
+
+ /// `FSCONFIG_SET_FD`
+ SetFd = 5,
+
+ /// `FSCONFIG_CMD_CREATE`
+ Create = 6,
+
+ /// `FSCONFIG_CMD_RECONFIGURE`
+ Reconfigure = 7,
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `MOUNT_ATTR_*` constants for use with [`fsmount`].
+ ///
+ /// [`fsmount`]: crate::mount::fsmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountAttrFlags: c::c_uint {
+ /// `MOUNT_ATTR_RDONLY`
+ const MOUNT_ATTR_RDONLY = 0x00000001;
+
+ /// `MOUNT_ATTR_NOSUID`
+ const MOUNT_ATTR_NOSUID = 0x00000002;
+
+ /// `MOUNT_ATTR_NODEV`
+ const MOUNT_ATTR_NODEV = 0x00000004;
+
+ /// `MOUNT_ATTR_NOEXEC`
+ const MOUNT_ATTR_NOEXEC = 0x00000008;
+
+ /// `MOUNT_ATTR__ATIME`
+ const MOUNT_ATTR__ATIME = 0x00000070;
+
+ /// `MOUNT_ATTR_RELATIME`
+ const MOUNT_ATTR_RELATIME = 0x00000000;
+
+ /// `MOUNT_ATTR_NOATIME`
+ const MOUNT_ATTR_NOATIME = 0x00000010;
+
+ /// `MOUNT_ATTR_STRICTATIME`
+ const MOUNT_ATTR_STRICTATIME = 0x00000020;
+
+ /// `MOUNT_ATTR_NODIRATIME`
+ const MOUNT_ATTR_NODIRATIME = 0x00000080;
+
+ /// `MOUNT_ATTR_NOUSER`
+ const MOUNT_ATTR_IDMAP = 0x00100000;
+
+ /// `MOUNT_ATTR__ATIME_FLAGS`
+ const MOUNT_ATTR_NOSYMFOLLOW = 0x00200000;
+
+ /// `MOUNT_ATTR__ATIME_FLAGS`
+ const MOUNT_ATTR_SIZE_VER0 = 32;
+ }
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `MOVE_MOUNT_*` constants for use with [`move_mount`].
+ ///
+ /// [`move_mount`]: crate::mount::move_mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MoveMountFlags: c::c_uint {
+ /// `MOVE_MOUNT_F_EMPTY_PATH`
+ const MOVE_MOUNT_F_SYMLINKS = 0x00000001;
+
+ /// `MOVE_MOUNT_F_AUTOMOUNTS`
+ const MOVE_MOUNT_F_AUTOMOUNTS = 0x00000002;
+
+ /// `MOVE_MOUNT_F_EMPTY_PATH`
+ const MOVE_MOUNT_F_EMPTY_PATH = 0x00000004;
+
+ /// `MOVE_MOUNT_T_SYMLINKS`
+ const MOVE_MOUNT_T_SYMLINKS = 0x00000010;
+
+ /// `MOVE_MOUNT_T_AUTOMOUNTS`
+ const MOVE_MOUNT_T_AUTOMOUNTS = 0x00000020;
+
+ /// `MOVE_MOUNT_T_EMPTY_PATH`
+ const MOVE_MOUNT_T_EMPTY_PATH = 0x00000040;
+
+ /// `MOVE_MOUNT__MASK`
+ const MOVE_MOUNT_SET_GROUP = 0x00000100;
+
+ // TODO: add when linux 6.5 is released
+ // /// `MOVE_MOUNT_BENEATH`
+ // const MOVE_MOUNT_BENEATH = 0x00000200;
+
+ /// `MOVE_MOUNT__MASK`
+ const MOVE_MOUNT__MASK = 0x00000377;
+ }
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `OPENTREE_*` constants for use with [`open_tree`].
+ ///
+ /// [`open_tree`]: crate::mount::open_tree
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct OpenTreeFlags: c::c_uint {
+ /// `OPENTREE_CLONE`
+ const OPEN_TREE_CLONE = 1;
+
+ /// `OPENTREE_CLOEXEC`
+ const OPEN_TREE_CLOEXEC = c::O_CLOEXEC as c::c_uint;
+
+ /// `AT_EMPTY_PATH`
+ const AT_EMPTY_PATH = c::AT_EMPTY_PATH as c::c_uint;
+
+ /// `AT_NO_AUTOMOUNT`
+ const AT_NO_AUTOMOUNT = c::AT_NO_AUTOMOUNT as c::c_uint;
+
+ /// `AT_RECURSIVE`
+ const AT_RECURSIVE = c::AT_RECURSIVE as c::c_uint;
+
+ /// `AT_SYMLINK_NOFOLLOW`
+ const AT_SYMLINK_NOFOLLOW = c::AT_SYMLINK_NOFOLLOW as c::c_uint;
+ }
+}
+
+#[cfg(feature = "mount")]
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `FSPICK_*` constants for use with [`fspick`].
+ ///
+ /// [`fspick`]: crate::mount::fspick
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsPickFlags: c::c_uint {
+ /// `FSPICK_CLOEXEC`
+ const FSPICK_CLOEXEC = 0x00000001;
+
+ /// `FSPICK_SYMLINK_NOFOLLOW`
+ const FSPICK_SYMLINK_NOFOLLOW = 0x00000002;
+
+ /// `FSPICK_NO_AUTOMOUNT`
+ const FSPICK_NO_AUTOMOUNT = 0x00000004;
+
+ /// `FSPICK_EMPTY_PATH`
+ const FSPICK_EMPTY_PATH = 0x00000008;
+ }
+}
+
+#[cfg(linux_kernel)]
+bitflags! {
+ /// `MS_*` constants for use with [`change_mount`].
+ ///
+ /// [`change_mount`]: crate::mount::change_mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountPropagationFlags: c::c_ulong {
+ /// `MS_SILENT`
+ const SILENT = c::MS_SILENT;
+ /// `MS_SHARED`
+ const SHARED = c::MS_SHARED;
+ /// `MS_PRIVATE`
+ const PRIVATE = c::MS_PRIVATE;
+ /// `MS_SLAVE`
+ const SLAVE = c::MS_SLAVE;
+ /// `MS_UNBINDABLE`
+ const UNBINDABLE = c::MS_UNBINDABLE;
+ /// `MS_REC`
+ const REC = c::MS_REC;
+ }
+}
+
+#[cfg(linux_kernel)]
+bitflags! {
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub(crate) struct InternalMountFlags: c::c_ulong {
+ const REMOUNT = c::MS_REMOUNT;
+ const MOVE = c::MS_MOVE;
+ }
+}
+
+#[cfg(linux_kernel)]
+pub(crate) struct MountFlagsArg(pub(crate) c::c_ulong);
diff --git a/vendor/rustix/src/backend/libc/net/addr.rs b/vendor/rustix/src/backend/libc/net/addr.rs
index bf7d239de..bd2e7dafe 100644
--- a/vendor/rustix/src/backend/libc/net/addr.rs
+++ b/vendor/rustix/src/backend/libc/net/addr.rs
@@ -76,12 +76,12 @@ impl SocketAddrUnix {
fn init() -> c::sockaddr_un {
c::sockaddr_un {
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "haiku", target_os = "nto"))]
sun_len: 0,
sun_family: c::AF_UNIX as _,
- #[cfg(bsd)]
+ #[cfg(any(bsd, target_os = "nto"))]
sun_path: [0; 104],
- #[cfg(not(any(bsd, target_os = "haiku")))]
+ #[cfg(not(any(bsd, target_os = "haiku", target_os = "nto")))]
sun_path: [0; 108],
#[cfg(target_os = "haiku")]
sun_path: [0; 126],
@@ -208,15 +208,15 @@ pub type SocketAddrStorage = c::sockaddr_storage;
#[inline]
pub(crate) fn offsetof_sun_path() -> usize {
let z = c::sockaddr_un {
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "haiku", target_os = "nto"))]
sun_len: 0_u8,
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))]
sun_family: 0_u8,
- #[cfg(not(any(bsd, target_os = "haiku")))]
+ #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))]
sun_family: 0_u16,
- #[cfg(bsd)]
+ #[cfg(any(bsd, target_os = "nto"))]
sun_path: [0; 104],
- #[cfg(not(any(bsd, target_os = "haiku")))]
+ #[cfg(not(any(bsd, target_os = "haiku", target_os = "nto")))]
sun_path: [0; 108],
#[cfg(target_os = "haiku")]
sun_path: [0; 126],
diff --git a/vendor/rustix/src/backend/libc/net/ext.rs b/vendor/rustix/src/backend/libc/net/ext.rs
index 4b2d10756..50bd89db6 100644
--- a/vendor/rustix/src/backend/libc/net/ext.rs
+++ b/vendor/rustix/src/backend/libc/net/ext.rs
@@ -78,7 +78,7 @@ pub(crate) const fn sockaddr_in6_sin6_scope_id(addr: &c::sockaddr_in6) -> u32 {
#[cfg(not(windows))]
#[inline]
pub(crate) const fn sockaddr_in6_new(
- #[cfg(any(bsd, target_os = "haiku"))] sin6_len: u8,
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sin6_len: u8,
sin6_family: c::sa_family_t,
sin6_port: u16,
sin6_flowinfo: u32,
@@ -86,7 +86,7 @@ pub(crate) const fn sockaddr_in6_new(
sin6_scope_id: u32,
) -> c::sockaddr_in6 {
c::sockaddr_in6 {
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))]
sin6_len,
sin6_family,
sin6_port,
diff --git a/vendor/rustix/src/backend/libc/net/mod.rs b/vendor/rustix/src/backend/libc/net/mod.rs
index 1b68f1b26..65c7d0654 100644
--- a/vendor/rustix/src/backend/libc/net/mod.rs
+++ b/vendor/rustix/src/backend/libc/net/mod.rs
@@ -1,6 +1,6 @@
pub(crate) mod addr;
pub(crate) mod ext;
-#[cfg(not(any(target_os = "redox", target_os = "wasi", windows)))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) mod msghdr;
pub(crate) mod read_sockaddr;
pub(crate) mod send_recv;
diff --git a/vendor/rustix/src/backend/libc/net/read_sockaddr.rs b/vendor/rustix/src/backend/libc/net/read_sockaddr.rs
index c3b23e8c2..cde851af6 100644
--- a/vendor/rustix/src/backend/libc/net/read_sockaddr.rs
+++ b/vendor/rustix/src/backend/libc/net/read_sockaddr.rs
@@ -26,11 +26,11 @@ struct sockaddr_header {
unsafe fn read_ss_family(storage: *const c::sockaddr_storage) -> u16 {
// Assert that we know the layout of `sockaddr`.
let _ = c::sockaddr {
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))]
sa_len: 0_u8,
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))]
sa_family: 0_u8,
- #[cfg(not(any(bsd, target_os = "haiku")))]
+ #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))]
sa_family: 0_u16,
#[cfg(not(target_os = "haiku"))]
sa_data: [0; 14],
diff --git a/vendor/rustix/src/backend/libc/net/send_recv.rs b/vendor/rustix/src/backend/libc/net/send_recv.rs
index e91017e97..26543a1fd 100644
--- a/vendor/rustix/src/backend/libc/net/send_recv.rs
+++ b/vendor/rustix/src/backend/libc/net/send_recv.rs
@@ -14,6 +14,8 @@ bitflags! {
bsd,
solarish,
windows,
+ target_os = "espidf",
+ target_os = "nto",
target_os = "haiku",
)))]
const CONFIRM = bitcast!(c::MSG_CONFIRM);
@@ -31,6 +33,7 @@ bitflags! {
solarish,
windows,
target_os = "haiku",
+ target_os = "nto",
)))]
const MORE = bitcast!(c::MSG_MORE);
#[cfg(not(any(apple, windows)))]
@@ -49,7 +52,7 @@ bitflags! {
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct RecvFlags: u32 {
- #[cfg(not(any(apple, solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(apple, solarish, windows, target_os = "espidf", target_os = "haiku", target_os = "nto")))]
/// `MSG_CMSG_CLOEXEC`
const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC);
/// `MSG_DONTWAIT`
@@ -60,7 +63,9 @@ bitflags! {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE);
/// `MSG_OOB`
diff --git a/vendor/rustix/src/backend/libc/net/syscalls.rs b/vendor/rustix/src/backend/libc/net/syscalls.rs
index 63067ff38..b4550583c 100644
--- a/vendor/rustix/src/backend/libc/net/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/net/syscalls.rs
@@ -10,7 +10,7 @@ use crate::io;
use crate::net::{SocketAddrAny, SocketAddrV4, SocketAddrV6};
use crate::utils::as_ptr;
use core::mem::{size_of, MaybeUninit};
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
use {
super::msghdr::{with_noaddr_msghdr, with_recv_msghdr, with_v4_msghdr, with_v6_msghdr},
crate::io::{IoSlice, IoSliceMut},
@@ -256,7 +256,7 @@ pub(crate) fn accept(sockfd: BorrowedFd<'_>) -> io::Result<OwnedFd> {
}
}
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn recvmsg(
sockfd: BorrowedFd<'_>,
iov: &mut [IoSliceMut<'_>],
@@ -288,7 +288,7 @@ pub(crate) fn recvmsg(
})
}
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn sendmsg(
sockfd: BorrowedFd<'_>,
iov: &[IoSlice<'_>],
@@ -304,7 +304,7 @@ pub(crate) fn sendmsg(
})
}
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn sendmsg_v4(
sockfd: BorrowedFd<'_>,
addr: &SocketAddrV4,
@@ -321,7 +321,7 @@ pub(crate) fn sendmsg_v4(
})
}
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub(crate) fn sendmsg_v6(
sockfd: BorrowedFd<'_>,
addr: &SocketAddrV6,
@@ -338,7 +338,7 @@ pub(crate) fn sendmsg_v6(
})
}
-#[cfg(all(unix, not(target_os = "redox")))]
+#[cfg(all(unix, not(any(target_os = "espidf", target_os = "redox"))))]
pub(crate) fn sendmsg_unix(
sockfd: BorrowedFd<'_>,
addr: &SocketAddrUnix,
@@ -358,8 +358,10 @@ pub(crate) fn sendmsg_unix(
#[cfg(not(any(
apple,
windows,
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
+ target_os = "nto",
target_os = "wasi",
)))]
pub(crate) fn accept_with(sockfd: BorrowedFd<'_>, flags: SocketFlags) -> io::Result<OwnedFd> {
@@ -394,7 +396,9 @@ pub(crate) fn acceptfrom(sockfd: BorrowedFd<'_>) -> io::Result<(OwnedFd, Option<
#[cfg(not(any(
apple,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -420,14 +424,26 @@ pub(crate) fn acceptfrom_with(
/// Darwin lacks `accept4`, but does have `accept`. We define
/// `SocketFlags` to have no flags, so we can discard it here.
-#[cfg(any(apple, windows, target_os = "haiku"))]
+#[cfg(any(
+ apple,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto"
+))]
pub(crate) fn accept_with(sockfd: BorrowedFd<'_>, _flags: SocketFlags) -> io::Result<OwnedFd> {
accept(sockfd)
}
/// Darwin lacks `accept4`, but does have `accept`. We define
/// `SocketFlags` to have no flags, so we can discard it here.
-#[cfg(any(apple, windows, target_os = "haiku"))]
+#[cfg(any(
+ apple,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto"
+))]
pub(crate) fn acceptfrom_with(
sockfd: BorrowedFd<'_>,
_flags: SocketFlags,
@@ -893,9 +909,21 @@ pub(crate) mod sockopt {
multiaddr: &Ipv6Addr,
interface: u32,
) -> io::Result<()> {
- #[cfg(not(any(bsd, solarish, target_os = "haiku", target_os = "l4re")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto"
+ )))]
use c::IPV6_ADD_MEMBERSHIP;
- #[cfg(any(bsd, solarish, target_os = "haiku", target_os = "l4re"))]
+ #[cfg(any(
+ bsd,
+ solarish,
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto"
+ ))]
use c::IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP;
let mreq = to_ipv6mr(multiaddr, interface);
@@ -918,9 +946,21 @@ pub(crate) mod sockopt {
multiaddr: &Ipv6Addr,
interface: u32,
) -> io::Result<()> {
- #[cfg(not(any(bsd, solarish, target_os = "haiku", target_os = "l4re")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto"
+ )))]
use c::IPV6_DROP_MEMBERSHIP;
- #[cfg(any(bsd, solarish, target_os = "haiku", target_os = "l4re"))]
+ #[cfg(any(
+ bsd,
+ solarish,
+ target_os = "haiku",
+ target_os = "l4re",
+ target_os = "nto"
+ ))]
use c::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP;
let mreq = to_ipv6mr(multiaddr, interface);
diff --git a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs
index efb5a4e14..46f0ef40a 100644
--- a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs
+++ b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs
@@ -23,7 +23,7 @@ pub(crate) unsafe fn write_sockaddr(
pub(crate) unsafe fn encode_sockaddr_v4(v4: &SocketAddrV4) -> c::sockaddr_in {
c::sockaddr_in {
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))]
sin_len: size_of::<c::sockaddr_in>() as _,
sin_family: c::AF_INET as _,
sin_port: u16::to_be(v4.port()),
@@ -42,7 +42,7 @@ unsafe fn write_sockaddr_v4(v4: &SocketAddrV4, storage: *mut SocketAddrStorage)
}
pub(crate) unsafe fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 {
- #[cfg(any(bsd, target_os = "haiku"))]
+ #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))]
{
sockaddr_in6_new(
size_of::<c::sockaddr_in6>() as _,
@@ -53,7 +53,7 @@ pub(crate) unsafe fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 {
v6.scope_id(),
)
}
- #[cfg(not(any(bsd, target_os = "haiku")))]
+ #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))]
{
sockaddr_in6_new(
c::AF_INET6 as _,
diff --git a/vendor/rustix/src/backend/libc/pipe/syscalls.rs b/vendor/rustix/src/backend/libc/pipe/syscalls.rs
index c5ded9174..24262cc9a 100644
--- a/vendor/rustix/src/backend/libc/pipe/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/pipe/syscalls.rs
@@ -2,7 +2,14 @@ use crate::backend::c;
use crate::backend::conv::ret;
use crate::fd::OwnedFd;
use crate::io;
-#[cfg(not(any(apple, target_os = "aix", target_os = "haiku", target_os = "wasi")))]
+#[cfg(not(any(
+ apple,
+ target_os = "aix",
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "wasi"
+)))]
use crate::pipe::PipeFlags;
use core::mem::MaybeUninit;
#[cfg(linux_kernel)]
@@ -11,7 +18,7 @@ use {
crate::backend::MAX_IOV,
crate::fd::BorrowedFd,
crate::pipe::{IoSliceRaw, SpliceFlags},
- crate::utils::optional_as_mut_ptr,
+ crate::utils::option_as_mut_ptr,
core::cmp::min,
};
@@ -25,7 +32,14 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> {
}
}
-#[cfg(not(any(apple, target_os = "aix", target_os = "haiku", target_os = "wasi")))]
+#[cfg(not(any(
+ apple,
+ target_os = "aix",
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "wasi"
+)))]
pub(crate) fn pipe_with(flags: PipeFlags) -> io::Result<(OwnedFd, OwnedFd)> {
unsafe {
let mut result = MaybeUninit::<[OwnedFd; 2]>::uninit();
@@ -48,8 +62,8 @@ pub fn splice(
len: usize,
flags: SpliceFlags,
) -> io::Result<usize> {
- let off_in = optional_as_mut_ptr(off_in).cast();
- let off_out = optional_as_mut_ptr(off_out).cast();
+ let off_in = option_as_mut_ptr(off_in).cast();
+ let off_out = option_as_mut_ptr(off_out).cast();
unsafe {
ret_usize(c::splice(
diff --git a/vendor/rustix/src/backend/libc/pipe/types.rs b/vendor/rustix/src/backend/libc/pipe/types.rs
index f48d8041b..3fa0464e0 100644
--- a/vendor/rustix/src/backend/libc/pipe/types.rs
+++ b/vendor/rustix/src/backend/libc/pipe/types.rs
@@ -16,7 +16,9 @@ bitflags! {
/// `O_DIRECT`
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
target_os = "openbsd",
target_os = "redox",
)))]
@@ -85,9 +87,8 @@ impl<'a> IoSliceRaw<'a> {
#[cfg(not(any(apple, target_os = "wasi")))]
#[test]
fn test_types() {
- use core::mem::size_of;
- assert_eq!(size_of::<PipeFlags>(), size_of::<c::c_int>());
+ assert_eq_size!(PipeFlags, c::c_int);
#[cfg(linux_kernel)]
- assert_eq!(size_of::<SpliceFlags>(), size_of::<c::c_int>());
+ assert_eq_size!(SpliceFlags, c::c_int);
}
diff --git a/vendor/rustix/src/backend/libc/process/mod.rs b/vendor/rustix/src/backend/libc/process/mod.rs
index 24f43d443..4d9a9f0a0 100644
--- a/vendor/rustix/src/backend/libc/process/mod.rs
+++ b/vendor/rustix/src/backend/libc/process/mod.rs
@@ -3,5 +3,5 @@ pub(crate) mod cpu_set;
#[cfg(not(windows))]
pub(crate) mod syscalls;
pub(crate) mod types;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) mod wait;
diff --git a/vendor/rustix/src/backend/libc/process/syscalls.rs b/vendor/rustix/src/backend/libc/process/syscalls.rs
index 0aa29b0b1..a84385cf1 100644
--- a/vendor/rustix/src/backend/libc/process/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/process/syscalls.rs
@@ -3,14 +3,21 @@
#[cfg(any(linux_kernel, target_os = "dragonfly", target_os = "fuchsia"))]
use super::types::RawCpuSet;
use crate::backend::c;
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(feature = "fs")]
+use crate::backend::conv::c_str;
+#[cfg(all(feature = "fs", not(target_os = "wasi")))]
+use crate::backend::conv::ret_discarded_char_ptr;
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
use crate::backend::conv::ret_infallible;
#[cfg(linux_kernel)]
use crate::backend::conv::ret_u32;
#[cfg(not(target_os = "wasi"))]
use crate::backend::conv::{borrowed_fd, ret_pid_t, ret_usize};
-#[cfg(feature = "fs")]
-use crate::backend::conv::{c_str, ret_discarded_char_ptr};
use crate::backend::conv::{ret, ret_c_int};
#[cfg(not(target_os = "wasi"))]
use crate::fd::BorrowedFd;
@@ -21,15 +28,27 @@ use crate::ffi::CStr;
#[cfg(feature = "fs")]
use crate::fs::Mode;
use crate::io;
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
use crate::process::Uid;
#[cfg(linux_kernel)]
use crate::process::{Cpuid, MembarrierCommand, MembarrierQuery};
#[cfg(not(target_os = "wasi"))]
-use crate::process::{Gid, Pid, RawPid, Signal, WaitOptions, WaitStatus};
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+use crate::process::{Gid, Pid};
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
+use crate::process::{RawPid, Signal, WaitOptions, WaitStatus};
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
use crate::process::{Resource, Rlimit};
-#[cfg(not(any(target_os = "redox", target_os = "openbsd", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "openbsd",
+ target_os = "wasi"
+)))]
use crate::process::{WaitId, WaitidOptions, WaitidStatus};
use core::mem::MaybeUninit;
#[cfg(target_os = "linux")]
@@ -43,7 +62,7 @@ pub(crate) fn chdir(path: &CStr) -> io::Result<()> {
unsafe { ret(c::chdir(c_str(path))) }
}
-#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
+#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
pub(crate) fn fchdir(dirfd: BorrowedFd<'_>) -> io::Result<()> {
unsafe { ret(c::fchdir(borrowed_fd(dirfd))) }
}
@@ -196,7 +215,7 @@ pub(crate) fn nice(inc: i32) -> io::Result<i32> {
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
#[inline]
pub(crate) fn getpriority_user(uid: Uid) -> io::Result<i32> {
libc_errno::set_errno(libc_errno::Errno(0));
@@ -208,7 +227,7 @@ pub(crate) fn getpriority_user(uid: Uid) -> io::Result<i32> {
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
#[inline]
pub(crate) fn getpriority_pgrp(pgid: Option<Pid>) -> io::Result<i32> {
libc_errno::set_errno(libc_errno::Errno(0));
@@ -220,7 +239,7 @@ pub(crate) fn getpriority_pgrp(pgid: Option<Pid>) -> io::Result<i32> {
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
#[inline]
pub(crate) fn getpriority_process(pid: Option<Pid>) -> io::Result<i32> {
libc_errno::set_errno(libc_errno::Errno(0));
@@ -232,13 +251,13 @@ pub(crate) fn getpriority_process(pid: Option<Pid>) -> io::Result<i32> {
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
#[inline]
pub(crate) fn setpriority_user(uid: Uid, priority: i32) -> io::Result<()> {
unsafe { ret(c::setpriority(c::PRIO_USER, uid.as_raw() as _, priority)) }
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
#[inline]
pub(crate) fn setpriority_pgrp(pgid: Option<Pid>, priority: i32) -> io::Result<()> {
unsafe {
@@ -250,7 +269,7 @@ pub(crate) fn setpriority_pgrp(pgid: Option<Pid>, priority: i32) -> io::Result<(
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "fuchsia", target_os = "wasi")))]
#[inline]
pub(crate) fn setpriority_process(pid: Option<Pid>, priority: i32) -> io::Result<()> {
unsafe {
@@ -262,7 +281,12 @@ pub(crate) fn setpriority_process(pid: Option<Pid>, priority: i32) -> io::Result
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
#[inline]
pub(crate) fn getrlimit(limit: Resource) -> Rlimit {
let mut result = MaybeUninit::<c::rlimit>::uninit();
@@ -272,7 +296,12 @@ pub(crate) fn getrlimit(limit: Resource) -> Rlimit {
}
}
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
#[inline]
pub(crate) fn setrlimit(limit: Resource, new: Rlimit) -> io::Result<()> {
let lim = rlimit_to_libc(new)?;
@@ -296,7 +325,12 @@ pub(crate) fn prlimit(pid: Option<Pid>, limit: Resource, new: Rlimit) -> io::Res
}
/// Convert a Rust [`Rlimit`] to a C `c::rlimit`.
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
fn rlimit_from_libc(lim: c::rlimit) -> Rlimit {
let current = if lim.rlim_cur == c::RLIM_INFINITY {
None
@@ -312,7 +346,12 @@ fn rlimit_from_libc(lim: c::rlimit) -> Rlimit {
}
/// Convert a C `c::rlimit` to a Rust `Rlimit`.
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
fn rlimit_to_libc(lim: Rlimit) -> io::Result<c::rlimit> {
let Rlimit { current, maximum } = lim;
let rlim_cur = match current {
@@ -326,13 +365,13 @@ fn rlimit_to_libc(lim: Rlimit) -> io::Result<c::rlimit> {
Ok(c::rlimit { rlim_cur, rlim_max })
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn wait(waitopts: WaitOptions) -> io::Result<Option<(Pid, WaitStatus)>> {
_waitpid(!0, waitopts)
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn waitpid(
pid: Option<Pid>,
@@ -341,7 +380,7 @@ pub(crate) fn waitpid(
_waitpid(Pid::as_raw(pid), waitopts)
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn _waitpid(
pid: RawPid,
@@ -354,7 +393,12 @@ pub(crate) fn _waitpid(
}
}
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "openbsd",
+ target_os = "wasi"
+)))]
#[inline]
pub(crate) fn waitid(id: WaitId<'_>, options: WaitidOptions) -> io::Result<Option<WaitidStatus>> {
// Get the id to wait on.
@@ -368,7 +412,12 @@ pub(crate) fn waitid(id: WaitId<'_>, options: WaitidOptions) -> io::Result<Optio
}
}
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "openbsd",
+ target_os = "wasi"
+)))]
#[inline]
fn _waitid_all(options: WaitidOptions) -> io::Result<Option<WaitidStatus>> {
// `waitid` can return successfully without initializing the struct (no
@@ -386,7 +435,12 @@ fn _waitid_all(options: WaitidOptions) -> io::Result<Option<WaitidStatus>> {
Ok(unsafe { cvt_waitid_status(status) })
}
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "openbsd",
+ target_os = "wasi"
+)))]
#[inline]
fn _waitid_pid(pid: Pid, options: WaitidOptions) -> io::Result<Option<WaitidStatus>> {
// `waitid` can return successfully without initializing the struct (no
@@ -428,7 +482,12 @@ fn _waitid_pidfd(fd: BorrowedFd<'_>, options: WaitidOptions) -> io::Result<Optio
///
/// The caller must ensure that `status` is initialized and that `waitid`
/// returned successfully.
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "openbsd",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
#[inline]
unsafe fn cvt_waitid_status(status: MaybeUninit<c::siginfo_t>) -> Option<WaitidStatus> {
let status = status.assume_init();
@@ -464,13 +523,13 @@ pub(crate) fn setsid() -> io::Result<Pid> {
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn kill_process(pid: Pid, sig: Signal) -> io::Result<()> {
unsafe { ret(c::kill(pid.as_raw_nonzero().get(), sig as i32)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn kill_process_group(pid: Pid, sig: Signal) -> io::Result<()> {
unsafe {
@@ -481,25 +540,24 @@ pub(crate) fn kill_process_group(pid: Pid, sig: Signal) -> io::Result<()> {
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn kill_current_process_group(sig: Signal) -> io::Result<()> {
unsafe { ret(c::kill(0, sig as i32)) }
}
-#[cfg(not(target_os = "wasi"))]
-#[inline]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn test_kill_process(pid: Pid) -> io::Result<()> {
unsafe { ret(c::kill(pid.as_raw_nonzero().get(), 0)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn test_kill_process_group(pid: Pid) -> io::Result<()> {
unsafe { ret(c::kill(pid.as_raw_nonzero().get().wrapping_neg(), 0)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn test_kill_current_process_group() -> io::Result<()> {
unsafe { ret(c::kill(0, 0)) }
@@ -561,7 +619,12 @@ 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 = "espidf",
+ 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)) }
diff --git a/vendor/rustix/src/backend/libc/process/types.rs b/vendor/rustix/src/backend/libc/process/types.rs
index 980c0effe..9c543acd0 100644
--- a/vendor/rustix/src/backend/libc/process/types.rs
+++ b/vendor/rustix/src/backend/libc/process/types.rs
@@ -40,9 +40,15 @@ pub enum MembarrierCommand {
/// [`getrlimit`]: crate::process::getrlimit
/// [`setrlimit`]: crate::process::setrlimit
/// [`prlimit`]: crate::process::prlimit
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
-#[repr(u32)]
+#[cfg_attr(not(target_os = "l4re"), repr(u32))]
+#[cfg_attr(target_os = "l4re", repr(u64))]
pub enum Resource {
/// `RLIMIT_CPU`
Cpu = bitcast!(c::RLIMIT_CPU),
@@ -56,7 +62,8 @@ pub enum Resource {
#[cfg(not(target_os = "haiku"))]
Core = bitcast!(c::RLIMIT_CORE),
/// `RLIMIT_RSS`
- #[cfg(not(any(apple, solarish, target_os = "haiku")))]
+ // "nto" has `RLIMIT_RSS`, but it has the same value as `RLIMIT_AS`.
+ #[cfg(not(any(apple, solarish, target_os = "nto", target_os = "haiku")))]
Rss = bitcast!(c::RLIMIT_RSS),
/// `RLIMIT_NPROC`
#[cfg(not(any(solarish, target_os = "haiku")))]
@@ -70,19 +77,49 @@ pub enum Resource {
#[cfg(not(target_os = "openbsd"))]
As = bitcast!(c::RLIMIT_AS),
/// `RLIMIT_LOCKS`
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
Locks = bitcast!(c::RLIMIT_LOCKS),
/// `RLIMIT_SIGPENDING`
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
Sigpending = bitcast!(c::RLIMIT_SIGPENDING),
/// `RLIMIT_MSGQUEUE`
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
Msgqueue = bitcast!(c::RLIMIT_MSGQUEUE),
/// `RLIMIT_NICE`
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
Nice = bitcast!(c::RLIMIT_NICE),
/// `RLIMIT_RTPRIO`
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
Rtprio = bitcast!(c::RLIMIT_RTPRIO),
/// `RLIMIT_RTTIME`
#[cfg(not(any(
@@ -92,6 +129,7 @@ pub enum Resource {
target_os = "android",
target_os = "emscripten",
target_os = "haiku",
+ target_os = "nto",
)))]
Rttime = bitcast!(c::RLIMIT_RTTIME),
}
@@ -105,7 +143,7 @@ impl Resource {
pub const EXIT_SUCCESS: c::c_int = c::EXIT_SUCCESS;
pub const EXIT_FAILURE: c::c_int = c::EXIT_FAILURE;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub const EXIT_SIGNALED_SIGABRT: c::c_int = 128 + c::SIGABRT;
/// A CPU identifier as a raw integer.
diff --git a/vendor/rustix/src/backend/libc/pty/syscalls.rs b/vendor/rustix/src/backend/libc/pty/syscalls.rs
index 178201ead..6688ddb26 100644
--- a/vendor/rustix/src/backend/libc/pty/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/pty/syscalls.rs
@@ -31,9 +31,26 @@ pub(crate) fn ptsname(fd: BorrowedFd, mut buffer: Vec<u8>) -> io::Result<CString
loop {
// On platforms with `ptsname_r`, use it.
- #[cfg(any(target_os = "freebsd", linux_like, target_os = "fuchsia"))]
+ #[cfg(any(linux_like, target_os = "fuchsia"))]
let r = unsafe { c::ptsname_r(borrowed_fd(fd), buffer.as_mut_ptr().cast(), buffer.len()) };
+ // FreeBSD 12 doesn't have `ptsname_r`.
+ #[cfg(target_os = "freebsd")]
+ let r = unsafe {
+ weak! {
+ fn ptsname_r(
+ c::c_int,
+ *mut c::c_char,
+ c::size_t
+ ) -> c::c_int
+ }
+ if let Some(func) = ptsname_r.get() {
+ func(borrowed_fd(fd), buffer.as_mut_ptr().cast(), buffer.len())
+ } else {
+ libc::ENOSYS
+ }
+ };
+
// MacOS 10.13.4 has `ptsname_r`; use it if we have it, otherwise fall
// back to calling the underlying ioctl directly.
#[cfg(apple)]
@@ -45,7 +62,7 @@ pub(crate) fn ptsname(fd: BorrowedFd, mut buffer: Vec<u8>) -> io::Result<CString
} else {
// The size declared in the `TIOCPTYGNAME` macro in sys/ttycom.h is 128.
let mut name: [u8; 128] = [0_u8; 128];
- match c::ioctl(borrowed_fd(fd), c::TIOCPTYGNAME as u64, &mut name) {
+ match c::ioctl(borrowed_fd(fd), c::TIOCPTYGNAME as _, &mut name) {
0 => {
let len = CStr::from_ptr(name.as_ptr().cast()).to_bytes().len();
std::ptr::copy_nonoverlapping(name.as_ptr(), buffer.as_mut_ptr(), len + 1);
diff --git a/vendor/rustix/src/backend/libc/system/syscalls.rs b/vendor/rustix/src/backend/libc/system/syscalls.rs
index a731e9302..27efd2653 100644
--- a/vendor/rustix/src/backend/libc/system/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/system/syscalls.rs
@@ -7,7 +7,12 @@ use crate::backend::conv::ret_infallible;
#[cfg(linux_kernel)]
use crate::system::Sysinfo;
use core::mem::MaybeUninit;
-#[cfg(not(any(target_os = "emscripten", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "emscripten",
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
use {crate::backend::conv::ret, crate::io};
#[cfg(not(target_os = "wasi"))]
@@ -15,7 +20,15 @@ use {crate::backend::conv::ret, crate::io};
pub(crate) fn uname() -> RawUname {
let mut uname = MaybeUninit::<RawUname>::uninit();
unsafe {
- ret_infallible(c::uname(uname.as_mut_ptr()));
+ let r = c::uname(uname.as_mut_ptr());
+
+ // On POSIX, `uname` is documented to return non-negative on success
+ // instead of the usual 0, though some specific systems do document
+ // that they always use zero allowing us to skip this check.
+ #[cfg(not(any(apple, freebsdlike, linux_like, target_os = "netbsd")))]
+ let r = core::cmp::min(r, 0);
+
+ ret_infallible(r);
uname.assume_init()
}
}
@@ -29,7 +42,12 @@ pub(crate) fn sysinfo() -> Sysinfo {
}
}
-#[cfg(not(any(target_os = "emscripten", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "emscripten",
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub(crate) fn sethostname(name: &[u8]) -> io::Result<()> {
unsafe {
ret(c::sethostname(
diff --git a/vendor/rustix/src/backend/libc/termios/syscalls.rs b/vendor/rustix/src/backend/libc/termios/syscalls.rs
index d4182f4fe..ea284927f 100644
--- a/vendor/rustix/src/backend/libc/termios/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/termios/syscalls.rs
@@ -5,21 +5,30 @@
//! See the `rustix::backend::syscalls` module documentation for details.
use crate::backend::c;
-use crate::backend::conv::{borrowed_fd, ret, ret_pid_t};
+#[cfg(not(target_os = "wasi"))]
+use crate::backend::conv::ret_pid_t;
+use crate::backend::conv::{borrowed_fd, ret};
use crate::fd::BorrowedFd;
#[cfg(feature = "procfs")]
#[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))]
use crate::ffi::CStr;
+#[cfg(any(
+ not(target_os = "espidf"),
+ all(
+ feature = "procfs",
+ not(any(target_os = "fuchsia", target_os = "wasi"))
+ )
+))]
use core::mem::MaybeUninit;
#[cfg(not(target_os = "wasi"))]
+use {crate::io, crate::pid::Pid};
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
use {
- crate::io,
- crate::pid::Pid,
crate::termios::{Action, OptionalActions, QueueSelector, Termios, Winsize},
crate::utils::as_mut_ptr,
};
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcgetattr(fd: BorrowedFd<'_>) -> io::Result<Termios> {
// If we have `TCGETS2`, use it, so that we fill in the `c_ispeed` and
// `c_ospeed` fields.
@@ -32,7 +41,7 @@ pub(crate) fn tcgetattr(fd: BorrowedFd<'_>) -> io::Result<Termios> {
ret(c::ioctl(
borrowed_fd(fd),
- c::TCGETS2.into(),
+ c::TCGETS2 as _,
termios2.as_mut_ptr(),
))?;
@@ -58,6 +67,8 @@ pub(crate) fn tcgetattr(fd: BorrowedFd<'_>) -> io::Result<Termios> {
unsafe {
let mut result = MaybeUninit::<Termios>::uninit();
+ // `result` is a `Termios` which starts with the same layout as
+ // `libc::termios`, so we can cast the pointer.
ret(c::tcgetattr(borrowed_fd(fd), result.as_mut_ptr().cast()))?;
Ok(result.assume_init())
@@ -77,7 +88,7 @@ pub(crate) fn tcsetpgrp(fd: BorrowedFd<'_>, pid: Pid) -> io::Result<()> {
unsafe { ret(c::tcsetpgrp(borrowed_fd(fd), pid.as_raw_nonzero().get())) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcsetattr(
fd: BorrowedFd,
optional_actions: OptionalActions,
@@ -104,7 +115,12 @@ pub(crate) fn tcsetattr(
// Translate from `optional_actions` into an ioctl request code. On MIPS,
// `optional_actions` already has `TCGETS` added to it.
let request = TCSETS2
- + if cfg!(any(target_arch = "mips", target_arch = "mips64")) {
+ + if cfg!(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )) {
optional_actions as u32 - TCSETS
} else {
optional_actions as u32
@@ -151,17 +167,17 @@ pub(crate) fn tcsendbreak(fd: BorrowedFd) -> io::Result<()> {
unsafe { ret(c::tcsendbreak(borrowed_fd(fd), 0)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcdrain(fd: BorrowedFd) -> io::Result<()> {
unsafe { ret(c::tcdrain(borrowed_fd(fd))) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcflush(fd: BorrowedFd, queue_selector: QueueSelector) -> io::Result<()> {
unsafe { ret(c::tcflush(borrowed_fd(fd), queue_selector as _)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcflow(fd: BorrowedFd, action: Action) -> io::Result<()> {
unsafe { ret(c::tcflow(borrowed_fd(fd), action as _)) }
}
@@ -174,12 +190,12 @@ pub(crate) fn tcgetsid(fd: BorrowedFd) -> io::Result<Pid> {
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcsetwinsize(fd: BorrowedFd, winsize: Winsize) -> io::Result<()> {
unsafe { ret(c::ioctl(borrowed_fd(fd), c::TIOCSWINSZ, &winsize)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub(crate) fn tcgetwinsize(fd: BorrowedFd) -> io::Result<Winsize> {
unsafe {
let mut buf = MaybeUninit::<Winsize>::uninit();
@@ -192,17 +208,27 @@ pub(crate) fn tcgetwinsize(fd: BorrowedFd) -> io::Result<Winsize> {
}
}
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub(crate) fn ioctl_tiocexcl(fd: BorrowedFd) -> io::Result<()> {
unsafe { ret(c::ioctl(borrowed_fd(fd), c::TIOCEXCL as _)) }
}
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub(crate) fn ioctl_tiocnxcl(fd: BorrowedFd) -> io::Result<()> {
unsafe { ret(c::ioctl(borrowed_fd(fd), c::TIOCNXCL as _)) }
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "nto", target_os = "wasi")))]
#[inline]
pub(crate) fn set_speed(termios: &mut Termios, arbitrary_speed: u32) -> io::Result<()> {
#[cfg(bsd)]
@@ -244,7 +270,7 @@ pub(crate) fn set_speed(termios: &mut Termios, arbitrary_speed: u32) -> io::Resu
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn set_output_speed(termios: &mut Termios, arbitrary_speed: u32) -> io::Result<()> {
#[cfg(bsd)]
@@ -284,7 +310,7 @@ pub(crate) fn set_output_speed(termios: &mut Termios, arbitrary_speed: u32) -> i
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
pub(crate) fn set_input_speed(termios: &mut Termios, arbitrary_speed: u32) -> io::Result<()> {
#[cfg(bsd)]
@@ -324,7 +350,7 @@ pub(crate) fn set_input_speed(termios: &mut Termios, arbitrary_speed: u32) -> io
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "nto", target_os = "wasi")))]
#[inline]
pub(crate) fn cfmakeraw(termios: &mut Termios) {
unsafe { c::cfmakeraw(as_mut_ptr(termios).cast()) }
diff --git a/vendor/rustix/src/backend/libc/thread/syscalls.rs b/vendor/rustix/src/backend/libc/thread/syscalls.rs
index 6066fd0d4..5260c39f4 100644
--- a/vendor/rustix/src/backend/libc/thread/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/thread/syscalls.rs
@@ -5,10 +5,7 @@ use crate::backend::conv::ret;
use crate::io;
#[cfg(not(target_os = "redox"))]
use crate::thread::{NanosleepRelativeResult, Timespec};
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
use crate::timespec::LibcTimespec;
use core::mem::MaybeUninit;
#[cfg(linux_kernel)]
@@ -22,6 +19,7 @@ use {
apple,
freebsdlike,
target_os = "emscripten",
+ target_os = "espidf",
target_os = "haiku",
target_os = "openbsd",
target_os = "redox",
@@ -29,21 +27,16 @@ use {
)))]
use {crate::thread::ClockId, core::ptr::null_mut};
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __clock_nanosleep_time64(c::clockid_t, c::c_int, *const LibcTimespec, *mut LibcTimespec) -> c::c_int);
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __nanosleep64(*const LibcTimespec, *mut LibcTimespec) -> c::c_int);
#[cfg(not(any(
apple,
target_os = "dragonfly",
target_os = "emscripten",
+ target_os = "espidf",
target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11.
target_os = "haiku",
target_os = "openbsd",
@@ -52,41 +45,38 @@ weak!(fn __nanosleep64(*const LibcTimespec, *mut LibcTimespec) -> c::c_int);
)))]
#[inline]
pub(crate) fn clock_nanosleep_relative(id: ClockId, request: &Timespec) -> NanosleepRelativeResult {
- let flags = 0;
-
- // 32-bit gnu version: libc has `clock_nanosleep` but it is not y2038 safe
- // by default.
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
- let mut remain = MaybeUninit::<LibcTimespec>::uninit();
-
+ // Old 32-bit version: libc has `clock_nanosleep` but it is not y2038 safe
+ // by default. But there may be a `__clock_nanosleep_time64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_clock_nanosleep) = __clock_nanosleep_time64.get() {
- match libc_clock_nanosleep(
- id as c::clockid_t,
- flags,
- &request.clone().into(),
- remain.as_mut_ptr(),
- ) {
- 0 => NanosleepRelativeResult::Ok,
- err if err == io::Errno::INTR.0 => {
- NanosleepRelativeResult::Interrupted(remain.assume_init().into())
- }
- err => NanosleepRelativeResult::Err(io::Errno(err)),
+ let flags = 0;
+ let mut remain = MaybeUninit::<LibcTimespec>::uninit();
+
+ unsafe {
+ return match libc_clock_nanosleep(
+ id as c::clockid_t,
+ flags,
+ &request.clone().into(),
+ remain.as_mut_ptr(),
+ ) {
+ 0 => NanosleepRelativeResult::Ok,
+ err if err == io::Errno::INTR.0 => {
+ NanosleepRelativeResult::Interrupted(remain.assume_init().into())
+ }
+ err => NanosleepRelativeResult::Err(io::Errno(err)),
+ };
}
- } else {
- clock_nanosleep_relative_old(id, request)
}
+
+ clock_nanosleep_relative_old(id, request)
}
// Main version: libc is y2038 safe and has `clock_nanosleep`.
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ #[cfg(not(fix_y2038))]
unsafe {
+ let flags = 0;
let mut remain = MaybeUninit::<Timespec>::uninit();
match c::clock_nanosleep(id as c::clockid_t, flags, request, remain.as_mut_ptr()) {
@@ -100,10 +90,10 @@ pub(crate) fn clock_nanosleep_relative(id: ClockId, request: &Timespec) -> Nanos
}
#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
+ fix_y2038,
+ not(any(apple, target_os = "emscripten", target_os = "haiku"))
))]
-unsafe fn clock_nanosleep_relative_old(id: ClockId, request: &Timespec) -> NanosleepRelativeResult {
+fn clock_nanosleep_relative_old(id: ClockId, request: &Timespec) -> NanosleepRelativeResult {
let tv_sec = match request.tv_sec.try_into() {
Ok(tv_sec) => tv_sec,
Err(_) => return NanosleepRelativeResult::Err(io::Errno::OVERFLOW),
@@ -116,22 +106,24 @@ unsafe fn clock_nanosleep_relative_old(id: ClockId, request: &Timespec) -> Nanos
let mut old_remain = MaybeUninit::<c::timespec>::uninit();
let flags = 0;
- match c::clock_nanosleep(
- id as c::clockid_t,
- flags,
- &old_request,
- old_remain.as_mut_ptr(),
- ) {
- 0 => NanosleepRelativeResult::Ok,
- err if err == io::Errno::INTR.0 => {
- let old_remain = old_remain.assume_init();
- let remain = Timespec {
- tv_sec: old_remain.tv_sec.into(),
- tv_nsec: old_remain.tv_nsec.into(),
- };
- NanosleepRelativeResult::Interrupted(remain)
+ unsafe {
+ match c::clock_nanosleep(
+ id as c::clockid_t,
+ flags,
+ &old_request,
+ old_remain.as_mut_ptr(),
+ ) {
+ 0 => NanosleepRelativeResult::Ok,
+ err if err == io::Errno::INTR.0 => {
+ let old_remain = old_remain.assume_init();
+ let remain = Timespec {
+ tv_sec: old_remain.tv_sec.into(),
+ tv_nsec: old_remain.tv_nsec.into(),
+ };
+ NanosleepRelativeResult::Interrupted(remain)
+ }
+ err => NanosleepRelativeResult::Err(io::Errno(err)),
}
- err => NanosleepRelativeResult::Err(io::Errno(err)),
}
}
@@ -139,6 +131,7 @@ unsafe fn clock_nanosleep_relative_old(id: ClockId, request: &Timespec) -> Nanos
apple,
target_os = "dragonfly",
target_os = "emscripten",
+ target_os = "espidf",
target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11.
target_os = "haiku",
target_os = "openbsd",
@@ -147,46 +140,46 @@ unsafe fn clock_nanosleep_relative_old(id: ClockId, request: &Timespec) -> Nanos
)))]
#[inline]
pub(crate) fn clock_nanosleep_absolute(id: ClockId, request: &Timespec) -> io::Result<()> {
- let flags = c::TIMER_ABSTIME;
-
- // 32-bit gnu version: libc has `clock_nanosleep` but it is not y2038 safe
- // by default.
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
+ // Old 32-bit version: libc has `clock_nanosleep` but it is not y2038 safe
+ // by default. But there may be a `__clock_nanosleep_time64` we can use.
+ #[cfg(fix_y2038)]
{
+ #[cfg(target_env = "gnu")]
if let Some(libc_clock_nanosleep) = __clock_nanosleep_time64.get() {
- match unsafe {
- libc_clock_nanosleep(
- id as c::clockid_t,
- flags,
- &request.clone().into(),
- null_mut(),
- )
- } {
- 0 => Ok(()),
- err => Err(io::Errno(err)),
+ let flags = c::TIMER_ABSTIME;
+ unsafe {
+ return match {
+ libc_clock_nanosleep(
+ id as c::clockid_t,
+ flags,
+ &request.clone().into(),
+ null_mut(),
+ )
+ } {
+ 0 => Ok(()),
+ err => Err(io::Errno(err)),
+ };
}
- } else {
- clock_nanosleep_absolute_old(id, request)
}
+
+ clock_nanosleep_absolute_old(id, request)
}
// Main version: libc is y2038 safe and has `clock_nanosleep`.
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
- match unsafe { c::clock_nanosleep(id as c::clockid_t, flags, request, null_mut()) } {
- 0 => Ok(()),
- err => Err(io::Errno(err)),
+ #[cfg(not(fix_y2038))]
+ {
+ let flags = c::TIMER_ABSTIME;
+
+ match unsafe { c::clock_nanosleep(id as c::clockid_t, flags as _, request, null_mut()) } {
+ 0 => Ok(()),
+ err => Err(io::Errno(err)),
+ }
}
}
#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
+ fix_y2038,
+ not(any(apple, target_os = "emscripten", target_os = "haiku"))
))]
fn clock_nanosleep_absolute_old(id: ClockId, request: &Timespec) -> io::Result<()> {
let flags = c::TIMER_ABSTIME;
@@ -204,33 +197,29 @@ fn clock_nanosleep_absolute_old(id: ClockId, request: &Timespec) -> io::Result<(
#[cfg(not(target_os = "redox"))]
#[inline]
pub(crate) fn nanosleep(request: &Timespec) -> NanosleepRelativeResult {
- // 32-bit gnu version: libc has `nanosleep` but it is not y2038 safe by
- // default.
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
- let mut remain = MaybeUninit::<LibcTimespec>::uninit();
-
+ // Old 32-bit version: libc has `nanosleep` but it is not y2038 safe by
+ // default. But there may be a `__nanosleep64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_nanosleep) = __nanosleep64.get() {
- match ret(libc_nanosleep(&request.clone().into(), remain.as_mut_ptr())) {
- Ok(()) => NanosleepRelativeResult::Ok,
- Err(io::Errno::INTR) => {
- NanosleepRelativeResult::Interrupted(remain.assume_init().into())
- }
- Err(err) => NanosleepRelativeResult::Err(err),
+ let mut remain = MaybeUninit::<LibcTimespec>::uninit();
+ unsafe {
+ return match ret(libc_nanosleep(&request.clone().into(), remain.as_mut_ptr())) {
+ Ok(()) => NanosleepRelativeResult::Ok,
+ Err(io::Errno::INTR) => {
+ NanosleepRelativeResult::Interrupted(remain.assume_init().into())
+ }
+ Err(err) => NanosleepRelativeResult::Err(err),
+ };
}
- } else {
- nanosleep_old(request)
}
+
+ nanosleep_old(request)
}
// Main version: libc is y2038 safe and has `nanosleep`.
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ #[cfg(not(fix_y2038))]
unsafe {
let mut remain = MaybeUninit::<Timespec>::uninit();
@@ -242,11 +231,8 @@ pub(crate) fn nanosleep(request: &Timespec) -> NanosleepRelativeResult {
}
}
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
-unsafe fn nanosleep_old(request: &Timespec) -> NanosleepRelativeResult {
+#[cfg(fix_y2038)]
+fn nanosleep_old(request: &Timespec) -> NanosleepRelativeResult {
let tv_sec = match request.tv_sec.try_into() {
Ok(tv_sec) => tv_sec,
Err(_) => return NanosleepRelativeResult::Err(io::Errno::OVERFLOW),
@@ -258,17 +244,19 @@ unsafe fn nanosleep_old(request: &Timespec) -> NanosleepRelativeResult {
let old_request = c::timespec { tv_sec, tv_nsec };
let mut old_remain = MaybeUninit::<c::timespec>::uninit();
- match ret(c::nanosleep(&old_request, old_remain.as_mut_ptr())) {
- Ok(()) => NanosleepRelativeResult::Ok,
- Err(io::Errno::INTR) => {
- let old_remain = old_remain.assume_init();
- let remain = Timespec {
- tv_sec: old_remain.tv_sec.into(),
- tv_nsec: old_remain.tv_nsec.into(),
- };
- NanosleepRelativeResult::Interrupted(remain)
+ unsafe {
+ match ret(c::nanosleep(&old_request, old_remain.as_mut_ptr())) {
+ Ok(()) => NanosleepRelativeResult::Ok,
+ Err(io::Errno::INTR) => {
+ let old_remain = old_remain.assume_init();
+ let remain = Timespec {
+ tv_sec: old_remain.tv_sec.into(),
+ tv_nsec: old_remain.tv_nsec.into(),
+ };
+ NanosleepRelativeResult::Interrupted(remain)
+ }
+ Err(err) => NanosleepRelativeResult::Err(err),
}
- Err(err) => NanosleepRelativeResult::Err(err),
}
}
diff --git a/vendor/rustix/src/backend/libc/time/syscalls.rs b/vendor/rustix/src/backend/libc/time/syscalls.rs
index 14ca22b2d..603a3b108 100644
--- a/vendor/rustix/src/backend/libc/time/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/time/syscalls.rs
@@ -2,13 +2,14 @@
use crate::backend::c;
use crate::backend::conv::ret;
+#[cfg(any(linux_kernel, target_os = "fuchsia"))]
+#[cfg(feature = "time")]
+#[cfg(any(all(target_env = "gnu", fix_y2038), not(fix_y2038)))]
+use crate::backend::time::types::LibcItimerspec;
#[cfg(not(target_os = "wasi"))]
use crate::clockid::{ClockId, DynamicClockId};
use crate::io;
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
use crate::timespec::LibcTimespec;
use crate::timespec::Timespec;
use core::mem::MaybeUninit;
@@ -16,36 +17,22 @@ use core::mem::MaybeUninit;
#[cfg(feature = "time")]
use {
crate::backend::conv::{borrowed_fd, ret_owned_fd},
- crate::backend::time::types::LibcItimerspec,
crate::fd::{BorrowedFd, OwnedFd},
crate::time::{Itimerspec, TimerfdClockId, TimerfdFlags, TimerfdTimerFlags},
};
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __clock_gettime64(c::clockid_t, *mut LibcTimespec) -> c::c_int);
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __clock_settime64(c::clockid_t, *const LibcTimespec) -> c::c_int);
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
weak!(fn __clock_getres64(c::clockid_t, *mut LibcTimespec) -> c::c_int);
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(any(linux_kernel, target_os = "fuchsia"))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
#[cfg(feature = "time")]
weak!(fn __timerfd_gettime64(c::c_int, *mut LibcItimerspec) -> c::c_int);
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(any(linux_kernel, target_os = "fuchsia"))]
+#[cfg(all(target_env = "gnu", fix_y2038))]
#[cfg(feature = "time")]
weak!(fn __timerfd_settime64(c::c_int, c::c_int, *const LibcItimerspec, *mut LibcItimerspec) -> c::c_int);
@@ -53,28 +40,24 @@ weak!(fn __timerfd_settime64(c::c_int, c::c_int, *const LibcItimerspec, *mut Lib
#[inline]
#[must_use]
pub(crate) fn clock_getres(id: ClockId) -> Timespec {
- // 32-bit gnu version: libc has `clock_getres` but it is not y2038 safe by
- // default.
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
- let mut timespec = MaybeUninit::<LibcTimespec>::uninit();
-
+ // Old 32-bit version: libc has `clock_getres` but it is not y2038 safe by
+ // default. But there may be a `__clock_getres64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_clock_getres) = __clock_getres64.get() {
- ret(libc_clock_getres(id as c::clockid_t, timespec.as_mut_ptr())).unwrap();
- timespec.assume_init().into()
- } else {
- clock_getres_old(id)
+ let mut timespec = MaybeUninit::<LibcTimespec>::uninit();
+ unsafe {
+ ret(libc_clock_getres(id as c::clockid_t, timespec.as_mut_ptr())).unwrap();
+ return timespec.assume_init().into();
+ }
}
+
+ clock_getres_old(id)
}
// Main version: libc is y2038 safe and has `clock_getres`.
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ #[cfg(not(fix_y2038))]
unsafe {
let mut timespec = MaybeUninit::<Timespec>::uninit();
let _ = c::clock_getres(id as c::clockid_t, timespec.as_mut_ptr());
@@ -82,19 +65,20 @@ pub(crate) fn clock_getres(id: ClockId) -> Timespec {
}
}
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[must_use]
-unsafe fn clock_getres_old(id: ClockId) -> Timespec {
+fn clock_getres_old(id: ClockId) -> Timespec {
let mut old_timespec = MaybeUninit::<c::timespec>::uninit();
- ret(c::clock_getres(
- id as c::clockid_t,
- old_timespec.as_mut_ptr(),
- ))
- .unwrap();
- let old_timespec = old_timespec.assume_init();
+
+ let old_timespec = unsafe {
+ ret(c::clock_getres(
+ id as c::clockid_t,
+ old_timespec.as_mut_ptr(),
+ ))
+ .unwrap();
+ old_timespec.assume_init()
+ };
+
Timespec {
tv_sec: old_timespec.tv_sec.into(),
tv_nsec: old_timespec.tv_nsec.into(),
@@ -105,33 +89,31 @@ unsafe fn clock_getres_old(id: ClockId) -> Timespec {
#[inline]
#[must_use]
pub(crate) fn clock_gettime(id: ClockId) -> Timespec {
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
- let mut timespec = MaybeUninit::<LibcTimespec>::uninit();
-
+ // Old 32-bit version: libc has `clock_gettime` but it is not y2038 safe by
+ // default. But there may be a `__clock_gettime64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_clock_gettime) = __clock_gettime64.get() {
- ret(libc_clock_gettime(
- id as c::clockid_t,
- timespec.as_mut_ptr(),
- ))
- .unwrap();
- timespec.assume_init().into()
- } else {
- clock_gettime_old(id)
+ let mut timespec = MaybeUninit::<LibcTimespec>::uninit();
+ unsafe {
+ ret(libc_clock_gettime(
+ id as c::clockid_t,
+ timespec.as_mut_ptr(),
+ ))
+ .unwrap();
+ return timespec.assume_init().into();
+ }
}
+
+ clock_gettime_old(id)
}
// Use `unwrap()` here because `clock_getres` can fail if the clock itself
// overflows a number of seconds, but if that happens, the monotonic clocks
// can't maintain their invariants, or the realtime clocks aren't properly
// configured.
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ #[cfg(not(fix_y2038))]
unsafe {
let mut timespec = MaybeUninit::<Timespec>::uninit();
ret(c::clock_gettime(id as c::clockid_t, timespec.as_mut_ptr())).unwrap();
@@ -139,19 +121,20 @@ pub(crate) fn clock_gettime(id: ClockId) -> Timespec {
}
}
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[must_use]
-unsafe fn clock_gettime_old(id: ClockId) -> Timespec {
+fn clock_gettime_old(id: ClockId) -> Timespec {
let mut old_timespec = MaybeUninit::<c::timespec>::uninit();
- ret(c::clock_gettime(
- id as c::clockid_t,
- old_timespec.as_mut_ptr(),
- ))
- .unwrap();
- let old_timespec = old_timespec.assume_init();
+
+ let old_timespec = unsafe {
+ ret(c::clock_gettime(
+ id as c::clockid_t,
+ old_timespec.as_mut_ptr(),
+ ))
+ .unwrap();
+ old_timespec.assume_init()
+ };
+
Timespec {
tv_sec: old_timespec.tv_sec.into(),
tv_nsec: old_timespec.tv_nsec.into(),
@@ -161,83 +144,85 @@ unsafe fn clock_gettime_old(id: ClockId) -> Timespec {
#[cfg(not(target_os = "wasi"))]
#[inline]
pub(crate) fn clock_gettime_dynamic(id: DynamicClockId<'_>) -> io::Result<Timespec> {
- unsafe {
- let id: c::clockid_t = match id {
- DynamicClockId::Known(id) => id as c::clockid_t,
-
- #[cfg(linux_kernel)]
- DynamicClockId::Dynamic(fd) => {
- use crate::fd::AsRawFd;
- const CLOCKFD: i32 = 3;
- (!fd.as_raw_fd() << 3) | CLOCKFD
- }
+ let id: c::clockid_t = match id {
+ DynamicClockId::Known(id) => id as c::clockid_t,
+
+ #[cfg(linux_kernel)]
+ DynamicClockId::Dynamic(fd) => {
+ use crate::fd::AsRawFd;
+ const CLOCKFD: i32 = 3;
+ (!fd.as_raw_fd() << 3) | CLOCKFD
+ }
- #[cfg(not(linux_kernel))]
- DynamicClockId::Dynamic(_fd) => {
- // Dynamic clocks are not supported on this platform.
- return Err(io::Errno::INVAL);
- }
+ #[cfg(not(linux_kernel))]
+ DynamicClockId::Dynamic(_fd) => {
+ // Dynamic clocks are not supported on this platform.
+ return Err(io::Errno::INVAL);
+ }
- #[cfg(linux_kernel)]
- DynamicClockId::RealtimeAlarm => c::CLOCK_REALTIME_ALARM,
+ #[cfg(linux_kernel)]
+ DynamicClockId::RealtimeAlarm => c::CLOCK_REALTIME_ALARM,
- #[cfg(linux_kernel)]
- DynamicClockId::Tai => c::CLOCK_TAI,
+ #[cfg(linux_kernel)]
+ DynamicClockId::Tai => c::CLOCK_TAI,
- #[cfg(any(linux_kernel, target_os = "openbsd"))]
- DynamicClockId::Boottime => c::CLOCK_BOOTTIME,
+ #[cfg(any(
+ freebsdlike,
+ linux_kernel,
+ target_os = "fuchsia",
+ target_os = "openbsd"
+ ))]
+ DynamicClockId::Boottime => c::CLOCK_BOOTTIME,
- #[cfg(linux_kernel)]
- DynamicClockId::BoottimeAlarm => c::CLOCK_BOOTTIME_ALARM,
- };
+ #[cfg(any(linux_kernel, target_os = "fuchsia"))]
+ DynamicClockId::BoottimeAlarm => c::CLOCK_BOOTTIME_ALARM,
+ };
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- {
+ // Old 32-bit version: libc has `clock_gettime` but it is not y2038
+ // safe by default. But there may be a `__clock_gettime64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
+ if let Some(libc_clock_gettime) = __clock_gettime64.get() {
let mut timespec = MaybeUninit::<LibcTimespec>::uninit();
-
- if let Some(libc_clock_gettime) = __clock_gettime64.get() {
+ unsafe {
ret(libc_clock_gettime(
id as c::clockid_t,
timespec.as_mut_ptr(),
))?;
- Ok(timespec.assume_init().into())
- } else {
- clock_gettime_dynamic_old(id)
+ return Ok(timespec.assume_init().into());
}
}
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
- {
- let mut timespec = MaybeUninit::<Timespec>::uninit();
+ clock_gettime_dynamic_old(id)
+ }
+
+ // Main version: libc is y2038 safe and has `clock_gettime`.
+ #[cfg(not(fix_y2038))]
+ unsafe {
+ let mut timespec = MaybeUninit::<Timespec>::uninit();
- ret(c::clock_gettime(id as c::clockid_t, timespec.as_mut_ptr()))?;
+ ret(c::clock_gettime(id as c::clockid_t, timespec.as_mut_ptr()))?;
- Ok(timespec.assume_init())
- }
+ Ok(timespec.assume_init())
}
}
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[inline]
-unsafe fn clock_gettime_dynamic_old(id: c::clockid_t) -> io::Result<Timespec> {
+fn clock_gettime_dynamic_old(id: c::clockid_t) -> io::Result<Timespec> {
let mut old_timespec = MaybeUninit::<c::timespec>::uninit();
- ret(c::clock_gettime(
- id as c::clockid_t,
- old_timespec.as_mut_ptr(),
- ))?;
+ let old_timespec = unsafe {
+ ret(c::clock_gettime(
+ id as c::clockid_t,
+ old_timespec.as_mut_ptr(),
+ ))?;
+
+ old_timespec.assume_init()
+ };
- let old_timespec = old_timespec.assume_init();
Ok(Timespec {
tv_sec: old_timespec.tv_sec.into(),
tv_nsec: old_timespec.tv_nsec.into(),
@@ -251,25 +236,25 @@ unsafe fn clock_gettime_dynamic_old(id: c::clockid_t) -> io::Result<Timespec> {
)))]
#[inline]
pub(crate) fn clock_settime(id: ClockId, timespec: Timespec) -> io::Result<()> {
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
+ // Old 32-bit version: libc has `clock_gettime` but it is not y2038 safe by
+ // default. But there may be a `__clock_settime64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_clock_settime) = __clock_settime64.get() {
- let mut new_timespec = core::mem::zeroed::<LibcTimespec>();
- new_timespec.tv_sec = timespec.tv_sec;
- new_timespec.tv_nsec = timespec.tv_nsec as _;
- ret(libc_clock_settime(id as c::clockid_t, &new_timespec))
- } else {
- clock_settime_old(id, timespec)
+ unsafe {
+ let mut new_timespec = core::mem::zeroed::<LibcTimespec>();
+ new_timespec.tv_sec = timespec.tv_sec;
+ new_timespec.tv_nsec = timespec.tv_nsec as _;
+ return ret(libc_clock_settime(id as c::clockid_t, &new_timespec));
+ }
}
+
+ clock_settime_old(id, timespec)
}
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ // Main version: libc is y2038 safe and has `clock_settime`.
+ #[cfg(not(fix_y2038))]
unsafe {
ret(c::clock_settime(id as c::clockid_t, &timespec))
}
@@ -280,11 +265,8 @@ pub(crate) fn clock_settime(id: ClockId, timespec: Timespec) -> io::Result<()> {
target_os = "wasi",
all(apple, not(target_os = "macos"))
)))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
-unsafe fn clock_settime_old(id: ClockId, timespec: Timespec) -> io::Result<()> {
+#[cfg(fix_y2038)]
+fn clock_settime_old(id: ClockId, timespec: Timespec) -> io::Result<()> {
let old_timespec = c::timespec {
tv_sec: timespec
.tv_sec
@@ -292,7 +274,8 @@ unsafe fn clock_settime_old(id: ClockId, timespec: Timespec) -> io::Result<()> {
.map_err(|_| io::Errno::OVERFLOW)?,
tv_nsec: timespec.tv_nsec as _,
};
- ret(c::clock_settime(id as c::clockid_t, &old_timespec))
+
+ unsafe { ret(c::clock_settime(id as c::clockid_t, &old_timespec)) }
}
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
@@ -308,31 +291,30 @@ pub(crate) fn timerfd_settime(
flags: TimerfdTimerFlags,
new_value: &Itimerspec,
) -> io::Result<Itimerspec> {
- let mut result = MaybeUninit::<LibcItimerspec>::uninit();
-
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
+ // Old 32-bit version: libc has `timerfd_settime` but it is not y2038 safe
+ // by default. But there may be a `__timerfd_settime64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_timerfd_settime) = __timerfd_settime64.get() {
- ret(libc_timerfd_settime(
- borrowed_fd(fd),
- bitflags_bits!(flags),
- &new_value.clone().into(),
- result.as_mut_ptr(),
- ))?;
- Ok(result.assume_init().into())
- } else {
- timerfd_settime_old(fd, flags, new_value)
+ let mut result = MaybeUninit::<LibcItimerspec>::uninit();
+ unsafe {
+ ret(libc_timerfd_settime(
+ borrowed_fd(fd),
+ bitflags_bits!(flags),
+ &new_value.clone().into(),
+ result.as_mut_ptr(),
+ ))?;
+ return Ok(result.assume_init().into());
+ }
}
+
+ timerfd_settime_old(fd, flags, new_value)
}
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ #[cfg(not(fix_y2038))]
unsafe {
+ let mut result = MaybeUninit::<LibcItimerspec>::uninit();
ret(c::timerfd_settime(
borrowed_fd(fd),
bitflags_bits!(flags),
@@ -344,12 +326,9 @@ pub(crate) fn timerfd_settime(
}
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[cfg(feature = "time")]
-unsafe fn timerfd_settime_old(
+fn timerfd_settime_old(
fd: BorrowedFd<'_>,
flags: TimerfdTimerFlags,
new_value: &Itimerspec,
@@ -384,14 +363,16 @@ unsafe fn timerfd_settime_old(
},
};
- ret(c::timerfd_settime(
- borrowed_fd(fd),
- bitflags_bits!(flags),
- &old_new_value,
- old_result.as_mut_ptr(),
- ))?;
+ let old_result = unsafe {
+ ret(c::timerfd_settime(
+ borrowed_fd(fd),
+ bitflags_bits!(flags),
+ &old_new_value,
+ old_result.as_mut_ptr(),
+ ))?;
+ old_result.assume_init()
+ };
- let old_result = old_result.assume_init();
Ok(Itimerspec {
it_interval: Timespec {
tv_sec: old_result
@@ -415,43 +396,41 @@ unsafe fn timerfd_settime_old(
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
#[cfg(feature = "time")]
pub(crate) fn timerfd_gettime(fd: BorrowedFd<'_>) -> io::Result<Itimerspec> {
- let mut result = MaybeUninit::<LibcItimerspec>::uninit();
-
- #[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- ))]
- unsafe {
+ // Old 32-bit version: libc has `timerfd_gettime` but it is not y2038 safe
+ // by default. But there may be a `__timerfd_gettime64` we can use.
+ #[cfg(fix_y2038)]
+ {
+ #[cfg(target_env = "gnu")]
if let Some(libc_timerfd_gettime) = __timerfd_gettime64.get() {
- ret(libc_timerfd_gettime(borrowed_fd(fd), result.as_mut_ptr()))?;
- Ok(result.assume_init().into())
- } else {
- timerfd_gettime_old(fd)
+ let mut result = MaybeUninit::<LibcItimerspec>::uninit();
+ unsafe {
+ ret(libc_timerfd_gettime(borrowed_fd(fd), result.as_mut_ptr()))?;
+ return Ok(result.assume_init().into());
+ }
}
+
+ timerfd_gettime_old(fd)
}
- #[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
- )))]
+ #[cfg(not(fix_y2038))]
unsafe {
+ let mut result = MaybeUninit::<LibcItimerspec>::uninit();
ret(c::timerfd_gettime(borrowed_fd(fd), result.as_mut_ptr()))?;
Ok(result.assume_init())
}
}
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[cfg(feature = "time")]
-unsafe fn timerfd_gettime_old(fd: BorrowedFd<'_>) -> io::Result<Itimerspec> {
+fn timerfd_gettime_old(fd: BorrowedFd<'_>) -> io::Result<Itimerspec> {
let mut old_result = MaybeUninit::<c::itimerspec>::uninit();
- ret(c::timerfd_gettime(borrowed_fd(fd), old_result.as_mut_ptr()))?;
+ let old_result = unsafe {
+ ret(c::timerfd_gettime(borrowed_fd(fd), old_result.as_mut_ptr()))?;
+ old_result.assume_init()
+ };
- let old_result = old_result.assume_init();
Ok(Itimerspec {
it_interval: Timespec {
tv_sec: old_result
diff --git a/vendor/rustix/src/backend/libc/time/types.rs b/vendor/rustix/src/backend/libc/time/types.rs
index e1d4a8736..75cc61217 100644
--- a/vendor/rustix/src/backend/libc/time/types.rs
+++ b/vendor/rustix/src/backend/libc/time/types.rs
@@ -1,15 +1,10 @@
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
use crate::backend::c;
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(any(linux_kernel, target_os = "fuchsia"))]
+#[cfg(fix_y2038)]
use crate::timespec::LibcTimespec;
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
use crate::timespec::Timespec;
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
use bitflags::bitflags;
@@ -20,10 +15,7 @@ use bitflags::bitflags;
/// [`timerfd_gettime`]: crate::time::timerfd_gettime
/// [`timerfd_settime`]: crate::time::timerfd_settime
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-)))]
+#[cfg(not(fix_y2038))]
pub type Itimerspec = c::itimerspec;
/// `struct itimerspec` for use with [`timerfd_gettime`] and
@@ -32,10 +24,7 @@ pub type Itimerspec = c::itimerspec;
/// [`timerfd_gettime`]: crate::time::timerfd_gettime
/// [`timerfd_settime`]: crate::time::timerfd_settime
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[allow(missing_docs)]
#[repr(C)]
#[derive(Debug, Clone)]
@@ -46,19 +35,13 @@ pub struct Itimerspec {
/// On most platforms, `LibcItimerspec` is just `Itimerspec`.
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-)))]
+#[cfg(not(fix_y2038))]
pub(crate) type LibcItimerspec = Itimerspec;
/// On 32-bit glibc platforms, `LibcTimespec` differs from `Timespec`, so we
/// define our own struct, with bidirectional `From` impls.
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[repr(C)]
#[derive(Debug, Clone)]
pub(crate) struct LibcItimerspec {
@@ -67,10 +50,7 @@ pub(crate) struct LibcItimerspec {
}
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
impl From<LibcItimerspec> for Itimerspec {
#[inline]
fn from(t: LibcItimerspec) -> Self {
@@ -82,10 +62,7 @@ impl From<LibcItimerspec> for Itimerspec {
}
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
impl From<Itimerspec> for LibcItimerspec {
#[inline]
fn from(t: Itimerspec) -> Self {
@@ -179,7 +156,6 @@ pub enum TimerfdClockId {
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
#[test]
fn test_types() {
- use core::mem::size_of;
- assert_eq!(size_of::<TimerfdFlags>(), size_of::<c::c_int>());
- assert_eq!(size_of::<TimerfdTimerFlags>(), size_of::<c::c_int>());
+ assert_eq_size!(TimerfdFlags, c::c_int);
+ assert_eq_size!(TimerfdTimerFlags, c::c_int);
}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/aarch64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/aarch64.rs
index 0f4465d51..0f4465d51 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/aarch64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/aarch64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/arm.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/arm.rs
index 9695c6028..9695c6028 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/arm.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/arm.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/mips.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips.rs
index b39a16847..b39a16847 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/mips.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs
new file mode 100644
index 000000000..718e94fa7
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips32r6.rs
@@ -0,0 +1,543 @@
+//! mipsisa32r6el Linux system calls.
+//!
+//! On mipsisa32r6el, Linux indicates success or failure using `$a3` rather
+//! than by returning a negative error code as most other architectures do.
+//!
+//! Mips-family platforms have a special calling convention for `__NR_pipe`,
+//! however we use `__NR_pipe2` instead to avoid having to implement it.
+
+use crate::backend::reg::{
+ ArgReg, FromAsm, RetReg, SyscallNumber, ToAsm, A0, A1, A2, A3, A4, A5, A6, R0,
+};
+use core::arch::asm;
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall0_readonly(nr: SyscallNumber) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
+ asm!(
+ "syscall",
+ in("$2" /*$v0*/) nr.to_asm(),
+ in("$4" /*$a0*/) a0.to_asm(),
+ options(noreturn)
+ )
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "sw {}, 20($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ in(reg) a5.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "sw {}, 20($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ in(reg) a5.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall7_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+ a6: ArgReg<'_, A6>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ ".set noat",
+ "subu $sp, 32",
+ "sw {}, 16($sp)",
+ "sw {}, 20($sp)",
+ "sw {}, 24($sp)",
+ "syscall",
+ "addu $sp, 32",
+ ".set at",
+ in(reg) a4.to_asm(),
+ in(reg) a5.to_asm(),
+ in(reg) a6.to_asm(),
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$t0*/) _,
+ lateout("$9" /*$t1*/) _,
+ lateout("$10" /*$t2*/) _,
+ lateout("$11" /*$t3*/) _,
+ lateout("$12" /*$t4*/) _,
+ lateout("$13" /*$t5*/) _,
+ lateout("$14" /*$t6*/) _,
+ lateout("$15" /*$t7*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/mips64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64.rs
index d3c7d341f..d3c7d341f 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/mips64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs
new file mode 100644
index 000000000..0a2ebebce
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mips64r6.rs
@@ -0,0 +1,470 @@
+//! mipsisa64r6el Linux system calls.
+//!
+//! On mipsisa64r6el, Linux indicates success or failure using `$a3` (`$7`)
+//! rather than by returning a negative error code as most other architectures
+//! do.
+//!
+//! Mips-family platforms have a special calling convention for `__NR_pipe`,
+//! however we use `__NR_pipe2` instead to avoid having to implement it.
+//!
+//! Note that MIPS R6 inline assembly currently doesn't differ from MIPS,
+//! because no explicit call of R6-only or R2-only instructions exist here.
+
+use crate::backend::reg::{
+ ArgReg, FromAsm, RetReg, SyscallNumber, ToAsm, A0, A1, A2, A3, A4, A5, R0,
+};
+use core::arch::asm;
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall0_readonly(nr: SyscallNumber) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
+ asm!(
+ "syscall",
+ in("$2" /*$v0*/) nr.to_asm(),
+ in("$4" /*$a0*/) a0.to_asm(),
+ options(noreturn)
+ )
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall2_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall3_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ lateout("$7" /*$a3*/) err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall4_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ lateout("$8" /*$a4*/) _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall5_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ lateout("$9" /*$a5*/) _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ inlateout("$9" /*$a5*/) a5.to_asm() => _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
+
+#[inline]
+pub(in crate::backend) unsafe fn syscall6_readonly(
+ nr: SyscallNumber<'_>,
+ a0: ArgReg<'_, A0>,
+ a1: ArgReg<'_, A1>,
+ a2: ArgReg<'_, A2>,
+ a3: ArgReg<'_, A3>,
+ a4: ArgReg<'_, A4>,
+ a5: ArgReg<'_, A5>,
+) -> RetReg<R0> {
+ let x0;
+ let err: usize;
+ asm!(
+ "syscall",
+ inlateout("$2" /*$v0*/) nr.to_asm() => x0,
+ in("$4" /*$a0*/) a0.to_asm(),
+ in("$5" /*$a1*/) a1.to_asm(),
+ in("$6" /*$a2*/) a2.to_asm(),
+ inlateout("$7" /*$a3*/) a3.to_asm() => err,
+ inlateout("$8" /*$a4*/) a4.to_asm() => _,
+ inlateout("$9" /*$a5*/) a5.to_asm() => _,
+ lateout("$10" /*$a6*/) _,
+ lateout("$11" /*$a7*/) _,
+ lateout("$12" /*$t0*/) _,
+ lateout("$13" /*$t1*/) _,
+ lateout("$14" /*$t2*/) _,
+ lateout("$15" /*$t3*/) _,
+ lateout("$24" /*$t8*/) _,
+ lateout("$25" /*$t9*/) _,
+ options(nostack, preserves_flags, readonly)
+ );
+ FromAsm::from_asm(if err != 0 {
+ (x0 as usize).wrapping_neg() as *mut _
+ } else {
+ x0
+ })
+}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/mod.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/mod.rs
index 7c26e23a4..3ea8eb74d 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/mod.rs
@@ -12,7 +12,9 @@
#[cfg_attr(all(target_arch = "arm", not(thumb_mode)), path = "arm.rs")]
#[cfg_attr(all(target_arch = "arm", thumb_mode), path = "thumb.rs")]
#[cfg_attr(target_arch = "mips", path = "mips.rs")]
+#[cfg_attr(target_arch = "mips32r6", path = "mips32r6.rs")]
#[cfg_attr(target_arch = "mips64", path = "mips64.rs")]
+#[cfg_attr(target_arch = "mips64r6", path = "mips64r6.rs")]
#[cfg_attr(target_arch = "powerpc64", path = "powerpc64.rs")]
#[cfg_attr(target_arch = "riscv64", path = "riscv64.rs")]
#[cfg_attr(target_arch = "x86", path = "x86.rs")]
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/powerpc64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/powerpc64.rs
index 8cca7dca7..8cca7dca7 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/powerpc64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/powerpc64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/riscv64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/riscv64.rs
index b1e306266..b1e306266 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/riscv64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/riscv64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/thumb.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/thumb.rs
index 398a73dfe..398a73dfe 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/thumb.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/thumb.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/x86.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/x86.rs
index 62947cb04..ddef4a854 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/x86.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/x86.rs
@@ -5,7 +5,10 @@
//! instruction.
//!
//! Most `rustix` syscalls use the vsyscall mechanism rather than going using
-//! `int 0x80` sequences.
+//! `int 0x80` sequences, as vsyscall is much faster.
+//!
+//! Syscalls made with `int 0x80` preserve the flags register, while syscalls
+//! made using vsyscall do not.
#![allow(dead_code)]
@@ -25,7 +28,6 @@ pub(in crate::backend) unsafe fn indirect_syscall0(
"call {callee}",
callee = in(reg) callee,
inlateout("eax") nr.to_asm() => r0,
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -42,7 +44,6 @@ pub(in crate::backend) unsafe fn indirect_syscall1(
callee = in(reg) callee,
inlateout("eax") nr.to_asm() => r0,
in("ebx") a0.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -76,7 +77,6 @@ pub(in crate::backend) unsafe fn indirect_syscall2(
inlateout("eax") nr.to_asm() => r0,
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -97,7 +97,6 @@ pub(in crate::backend) unsafe fn indirect_syscall3(
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -128,7 +127,6 @@ pub(in crate::backend) unsafe fn indirect_syscall4(
in("ebx") a0.to_asm(),
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -161,7 +159,6 @@ pub(in crate::backend) unsafe fn indirect_syscall5(
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
in("edi") a4.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
@@ -203,7 +200,6 @@ pub(in crate::backend) unsafe fn indirect_syscall6(
in("ecx") a1.to_asm(),
in("edx") a2.to_asm(),
in("edi") a4.to_asm(),
- options(preserves_flags)
);
FromAsm::from_asm(r0)
}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/inline/x86_64.rs b/vendor/rustix/src/backend/linux_raw/arch/asm/x86_64.rs
index 084f5fee4..084f5fee4 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/inline/x86_64.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/asm/x86_64.rs
diff --git a/vendor/rustix/src/backend/linux_raw/arch/mod.rs b/vendor/rustix/src/backend/linux_raw/arch/mod.rs
index cc93fc2c4..31a8c11f9 100644
--- a/vendor/rustix/src/backend/linux_raw/arch/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/arch/mod.rs
@@ -1,28 +1,20 @@
//! Architecture-specific syscall code.
//!
-//! `rustix` has inline assembly sequences using `asm!`, but that requires
-//! Rust 1.59, so it also has out-of-line ("outline") assembly sequences in .s
-//! files. And 32-bit x86 is special (see comments below).
-//!
//! This module also has a `choose` submodule which chooses a scheme and is
//! what most of the `rustix` syscalls use.
//!
//! # Safety
//!
//! This contains the inline `asm` statements performing the syscall
-//! instructions and FFI declarations declaring the out-of-line ("outline")
-//! syscall instructions.
+//! instructions.
#![allow(unsafe_code)]
#![cfg_attr(not(feature = "all-apis"), allow(unused_imports))]
// We'll use as many arguments as syscalls need.
#![allow(clippy::too_many_arguments)]
-// When inline asm is available, use it. Otherwise, use out-of-line asm. These
-// functions always use the machine's syscall instruction, even when it isn't
-// the fastest option available.
-#[cfg_attr(asm, path = "inline/mod.rs")]
-#[cfg_attr(not(asm), path = "outline/mod.rs")]
+// These functions always use the machine's syscall instruction, even when it
+// isn't the fastest option available.
pub(in crate::backend) mod asm;
// On most architectures, the architecture syscall instruction is fast, so use
@@ -31,7 +23,9 @@ pub(in crate::backend) mod asm;
target_arch = "arm",
target_arch = "aarch64",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "x86_64",
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/mips.s b/vendor/rustix/src/backend/linux_raw/arch/outline/mips.s
deleted file mode 100644
index b016ae124..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/mips.s
+++ /dev/null
@@ -1,211 +0,0 @@
-# Assembly code for making mips64 syscalls.
-#
-# mips64 syscall argument register ordering is the same as the mips64
-# userspace argument register ordering except that the syscall number
-# (nr) is passed in v0.
-#
-# outline.rs takes care of reordering the nr argument to the end for us,
-# so we only need to move nr into v0.
-
- .file "mips.s"
- .section .mdebug.abi32
- .previous
- .abicalls
-
- .section .text.rustix_syscall0_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall0_nr_last
- .hidden rustix_syscall0_nr_last
- .type rustix_syscall0_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall0_nr_last
-rustix_syscall0_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $4
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall0_nr_last
- .size rustix_syscall0_nr_last, .-rustix_syscall0_nr_last
-
- .section .text.rustix_syscall1_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_nr_last
- .hidden rustix_syscall1_nr_last
- .type rustix_syscall1_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_nr_last
-rustix_syscall1_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall1_nr_last
- .size rustix_syscall1_nr_last, .-rustix_syscall1_nr_last
-
- .section .text.rustix_syscall1_noreturn_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_noreturn_nr_last
- .hidden rustix_syscall1_noreturn_nr_last
- .type rustix_syscall1_noreturn_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_noreturn_nr_last
-rustix_syscall1_noreturn_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- teq $zero, $zero
- .end rustix_syscall1_noreturn_nr_last
- .size rustix_syscall1_noreturn_nr_last, .-rustix_syscall1_noreturn_nr_last
-
- .section .text.rustix_syscall2_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall2_nr_last
- .hidden rustix_syscall2_nr_last
- .type rustix_syscall2_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall2_nr_last
-rustix_syscall2_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $6
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall2_nr_last
- .size rustix_syscall2_nr_last, .-rustix_syscall2_nr_last
-
- .section .text.rustix_syscall3_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall3_nr_last
- .hidden rustix_syscall3_nr_last
- .type rustix_syscall3_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall3_nr_last
-rustix_syscall3_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $7
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall3_nr_last
- .size rustix_syscall3_nr_last, .-rustix_syscall3_nr_last
-
- .section .text.rustix_syscall4_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall4_nr_last
- .hidden rustix_syscall4_nr_last
- .type rustix_syscall4_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall4_nr_last
-rustix_syscall4_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 16($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall4_nr_last
- .size rustix_syscall4_nr_last, .-rustix_syscall4_nr_last
-
- .section .text.rustix_syscall5_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall5_nr_last
- .hidden rustix_syscall5_nr_last
- .type rustix_syscall5_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall5_nr_last
-rustix_syscall5_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 20($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall5_nr_last
- .size rustix_syscall5_nr_last, .-rustix_syscall5_nr_last
-
- .section .text.rustix_syscall6_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall6_nr_last
- .hidden rustix_syscall6_nr_last
- .type rustix_syscall6_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall6_nr_last
-rustix_syscall6_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 24($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall6_nr_last
- .size rustix_syscall6_nr_last, .-rustix_syscall6_nr_last
-
- .section .text.rustix_syscall7_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall7_nr_last
- .hidden rustix_syscall7_nr_last
- .type rustix_syscall7_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall7_nr_last
-rustix_syscall7_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- lw $2, 28($sp)
- syscall
- negu $8, $2
- jr $31
- movn $2, $8, $7
- .end rustix_syscall7_nr_last
- .size rustix_syscall7_nr_last, .-rustix_syscall7_nr_last
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s b/vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s
deleted file mode 100644
index a6473990e..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/mips64.s
+++ /dev/null
@@ -1,189 +0,0 @@
-# Assembly code for making mips64 syscalls.
-#
-# mips64 syscall argument register ordering is the same as the mips64
-# userspace argument register ordering except that the syscall number
-# (nr) is passed in v0.
-#
-# outline.rs takes care of reordering the nr argument to the end for us,
-# so we only need to move nr into v0.
-
- .file "mips64.s"
- .section .mdebug.abi64
- .previous
- .abicalls
-
- .section .text.rustix_syscall0_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall0_nr_last
- .hidden rustix_syscall0_nr_last
- .type rustix_syscall0_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall0_nr_last
-rustix_syscall0_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $4
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall0_nr_last
- .size rustix_syscall0_nr_last, .-rustix_syscall0_nr_last
-
- .section .text.rustix_syscall1_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_nr_last
- .hidden rustix_syscall1_nr_last
- .type rustix_syscall1_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_nr_last
-rustix_syscall1_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall1_nr_last
- .size rustix_syscall1_nr_last, .-rustix_syscall1_nr_last
-
- .section .text.rustix_syscall1_noreturn_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_noreturn_nr_last
- .hidden rustix_syscall1_noreturn_nr_last
- .type rustix_syscall1_noreturn_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall1_noreturn_nr_last
-rustix_syscall1_noreturn_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $5
- syscall
- teq $0, $0
- .end rustix_syscall1_noreturn_nr_last
- .size rustix_syscall1_noreturn_nr_last, .-rustix_syscall1_noreturn_nr_last
-
- .section .text.rustix_syscall2_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall2_nr_last
- .hidden rustix_syscall2_nr_last
- .type rustix_syscall2_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall2_nr_last
-rustix_syscall2_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $6
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall2_nr_last
- .size rustix_syscall2_nr_last, .-rustix_syscall2_nr_last
-
- .section .text.rustix_syscall3_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall3_nr_last
- .hidden rustix_syscall3_nr_last
- .type rustix_syscall3_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall3_nr_last
-rustix_syscall3_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $7
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall3_nr_last
- .size rustix_syscall3_nr_last, .-rustix_syscall3_nr_last
-
- .section .text.rustix_syscall4_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall4_nr_last
- .hidden rustix_syscall4_nr_last
- .type rustix_syscall4_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall4_nr_last
-rustix_syscall4_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $8
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall4_nr_last
- .size rustix_syscall4_nr_last, .-rustix_syscall4_nr_last
-
- .section .text.rustix_syscall5_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall5_nr_last
- .hidden rustix_syscall5_nr_last
- .type rustix_syscall5_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall5_nr_last
-rustix_syscall5_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $9
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall5_nr_last
- .size rustix_syscall5_nr_last, .-rustix_syscall5_nr_last
-
- .section .text.rustix_syscall6_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall6_nr_last
- .hidden rustix_syscall6_nr_last
- .type rustix_syscall6_nr_last, @function
- .set nomips16
- .set nomicromips
- .ent rustix_syscall6_nr_last
-rustix_syscall6_nr_last:
- .frame $sp,0,$31
- .mask 0x00000000,0
- .fmask 0x00000000,0
- .set noreorder
- .set nomacro
- move $2, $10
- syscall
- dnegu $12, $2
- jr $31
- movn $2, $12, $7
- .end rustix_syscall6_nr_last
- .size rustix_syscall6_nr_last, .-rustix_syscall6_nr_last
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs b/vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs
deleted file mode 100644
index 202a2cce9..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/mod.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-//! Declare functions defined in out-of-line ("outline") asm files.
-//!
-//! Kernel calling conventions differ from userspace calling conventions, so we
-//! also define inline function wrappers which reorder the arguments so that
-//! they match with the kernel convention as closely as possible, to minimize
-//! the amount of out-of-line code we need.
-//!
-//! This is needed because as of our MSRV of 1.63, inline asm and naked
-//! functions are experimental.
-
-#[cfg(target_arch = "x86")]
-mod x86;
-// For these architectures, pass the `nr` argument last.
-#[cfg(any(
- target_arch = "mips",
- target_arch = "mips64",
- target_arch = "powerpc64",
-))]
-mod nr_last;
-
-#[cfg(any(
- target_arch = "mips",
- target_arch = "mips64",
- target_arch = "powerpc64",
-))]
-pub(in crate::backend) use nr_last::*;
-#[cfg(target_arch = "x86")]
-pub(in crate::backend) use x86::*;
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs b/vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs
deleted file mode 100644
index 4af64d6c4..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/nr_last.rs
+++ /dev/null
@@ -1,166 +0,0 @@
-//! Syscall wrappers for platforms which pass the syscall number specially.
-//!
-//! Rustix aims to minimize the amount of assembly code it needs. To that end,
-//! this code reorders syscall arguments as close as feasible to the actual
-//! syscall convention before calling the assembly functions.
-//!
-//! Many architectures use a convention where the syscall number is passed in a
-//! special register, with the regular syscall arguments passed in either the
-//! same or similar registers as the platform C convention. This code
-//! approximates that order by passing the regular syscall arguments first, and
-//! the syscall number last. That way, the outline assembly code typically just
-//! needs to move the syscall number to its special register, and leave the
-//! other arguments mostly as they are.
-
-#[cfg(target_arch = "mips")]
-use crate::backend::reg::A6;
-use crate::backend::reg::{ArgReg, RetReg, SyscallNumber, A0, A1, A2, A3, A4, A5, R0};
-
-// First we declare the actual assembly routines with `*_nr_last` names and
-// reordered arguments. If the signatures or calling conventions are ever
-// changed, the symbol names should also be updated accordingly, to avoid
-// collisions with other versions of this crate.
-//
-// We don't define `_readonly` versions of these because we have no way to tell
-// Rust that calls to our outline assembly are readonly.
-extern "C" {
- fn rustix_syscall0_nr_last(nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_nr_last(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_noreturn_nr_last(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> !;
- fn rustix_syscall2_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall3_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall4_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall5_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall6_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- #[cfg(target_arch = "mips")]
- fn rustix_syscall7_nr_last(
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- a6: ArgReg<'_, A6>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
-}
-
-// Then we define inline wrapper functions that do the reordering.
-
-#[inline]
-pub(in crate::backend) unsafe fn syscall0(nr: SyscallNumber<'_>) -> RetReg<R0> {
- rustix_syscall0_nr_last(nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
- rustix_syscall1_nr_last(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
- rustix_syscall1_noreturn_nr_last(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall2(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
-) -> RetReg<R0> {
- rustix_syscall2_nr_last(a0, a1, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall3(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
-) -> RetReg<R0> {
- rustix_syscall3_nr_last(a0, a1, a2, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall4(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
-) -> RetReg<R0> {
- rustix_syscall4_nr_last(a0, a1, a2, a3, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall5(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
-) -> RetReg<R0> {
- rustix_syscall5_nr_last(a0, a1, a2, a3, a4, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall6(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
-) -> RetReg<R0> {
- rustix_syscall6_nr_last(a0, a1, a2, a3, a4, a5, nr)
-}
-#[cfg(target_arch = "mips")]
-#[inline]
-pub(in crate::backend) unsafe fn syscall7(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- a6: ArgReg<'_, A6>,
-) -> RetReg<R0> {
- rustix_syscall7_nr_last(a0, a1, a2, a3, a4, a5, a6, nr)
-}
-
-// Then we define the `_readonly` versions of the wrappers. We don't have
-// separate `_readonly` implementations, so these can just be aliases to
-// their non-`_readonly` counterparts.
-#[cfg(target_arch = "mips")]
-pub(in crate::backend) use syscall7 as syscall7_readonly;
-pub(in crate::backend) use {
- syscall0 as syscall0_readonly, syscall1 as syscall1_readonly, syscall2 as syscall2_readonly,
- syscall3 as syscall3_readonly, syscall4 as syscall4_readonly, syscall5 as syscall5_readonly,
- syscall6 as syscall6_readonly,
-};
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s b/vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s
deleted file mode 100644
index 29d4c0a95..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/powerpc64.s
+++ /dev/null
@@ -1,132 +0,0 @@
-# Assembly code for making powerpc64le syscalls.
-#
-# powerpc64le syscall argument register ordering is the same as the
-# powerpc64le userspace argument register ordering except that the syscall
-# number (nr) is passed in r0.
-#
-# outline.rs takes care of reordering the nr argument to the end for us,
-# so we only need to move nr into r0.
-
- .file "powerpc64le.s"
- .machine power8
- .abiversion 2
-
- .section .text.rustix_syscall0_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall0_nr_last
- .hidden rustix_syscall0_nr_last
- .type rustix_syscall0_nr_last, @function
-rustix_syscall0_nr_last:
- .cfi_startproc
- mr 0, 3
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall0_nr_last, .-rustix_syscall0_nr_last
-
- .section .text.rustix_syscall1_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_nr_last
- .hidden rustix_syscall1_nr_last
- .type rustix_syscall1_nr_last, @function
-rustix_syscall1_nr_last:
- .cfi_startproc
- mr 0, 4
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall1_nr_last, .-rustix_syscall1_nr_last
-
- .section .text.rustix_syscall1_noreturn_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall1_noreturn_nr_last
- .hidden rustix_syscall1_noreturn_nr_last
- .type rustix_syscall1_noreturn_nr_last, @function
-rustix_syscall1_noreturn_nr_last:
- .cfi_startproc
- mr 0, 4
- sc
- trap
- .cfi_endproc
- .size rustix_syscall1_noreturn_nr_last, .-rustix_syscall1_noreturn_nr_last
-
- .section .text.rustix_syscall2_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall2_nr_last
- .hidden rustix_syscall2_nr_last
- .type rustix_syscall2_nr_last, @function
-rustix_syscall2_nr_last:
- .cfi_startproc
- mr 0, 5
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall2_nr_last, .-rustix_syscall2_nr_last
-
- .section .text.rustix_syscall3_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall3_nr_last
- .hidden rustix_syscall3_nr_last
- .type rustix_syscall3_nr_last, @function
-rustix_syscall3_nr_last:
- .cfi_startproc
- mr 0, 6
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall3_nr_last, .-rustix_syscall3_nr_last
-
- .section .text.rustix_syscall4_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall4_nr_last
- .hidden rustix_syscall4_nr_last
- .type rustix_syscall4_nr_last, @function
-rustix_syscall4_nr_last:
- .cfi_startproc
- mr 0, 7
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall4_nr_last, .-rustix_syscall4_nr_last
-
- .section .text.rustix_syscall5_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall5_nr_last
- .hidden rustix_syscall5_nr_last
- .type rustix_syscall5_nr_last, @function
-rustix_syscall5_nr_last:
- .cfi_startproc
- mr 0, 8
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall5_nr_last, .-rustix_syscall5_nr_last
-
- .section .text.rustix_syscall6_nr_last,"ax",@progbits
- .p2align 2
- .weak rustix_syscall6_nr_last
- .hidden rustix_syscall6_nr_last
- .type rustix_syscall6_nr_last, @function
-rustix_syscall6_nr_last:
- .cfi_startproc
- mr 0, 9
- sc
- bnslr
- neg 3, 3
- blr
- .cfi_endproc
- .size rustix_syscall6_nr_last, .-rustix_syscall6_nr_last
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs b/vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs
deleted file mode 100644
index e74b8d2aa..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.rs
+++ /dev/null
@@ -1,285 +0,0 @@
-//! Syscall wrappers for 32-bit x86.
-//!
-//! This module is similar to the `nr_last` module, except specialized for
-//! 32-bit x86.
-//!
-//! The syscall convention passes all arguments in registers. The closest we
-//! can easily get to that from Rust is to use the fastcall convention which
-//! passes the first two arguments in `ecx` and `edx`, which are the second
-//! and third Linux syscall arguments. To line them up, this function passes
-//! the second and third syscall argument as the first and second argument to
-//! the outline assembly, followed by the first syscall argument, and then the
-//! rest of the syscall arguments. The assembly code still has to do some work,
-//! but at least we can get up to two arguments into the right place for it.
-
-#![allow(dead_code, unused_imports)]
-
-use crate::backend::reg::{ArgReg, RetReg, SyscallNumber, A0, A1, A2, A3, A4, A5, R0};
-use crate::backend::vdso_wrappers::SyscallType;
-
-// First we declare the actual assembly routines with `*_nr_last_fastcall`
-// names and reordered arguments. If the signatures or calling conventions are
-// ever changed, the symbol names should also be updated accordingly, to avoid
-// collisions with other versions of this crate.
-//
-// We don't define `_readonly` versions of these because we have no way to tell
-// Rust that calls to our outline assembly are readonly.
-extern "fastcall" {
- fn rustix_syscall0_nr_last_fastcall(nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_nr_last_fastcall(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> RetReg<R0>;
- fn rustix_syscall1_noreturn_nr_last_fastcall(a0: ArgReg<'_, A0>, nr: SyscallNumber<'_>) -> !;
- fn rustix_syscall2_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall3_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall4_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall5_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
- fn rustix_syscall6_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- nr: SyscallNumber<'_>,
- ) -> RetReg<R0>;
-}
-
-// Then we define inline wrapper functions that do the reordering.
-
-#[inline]
-pub(in crate::backend) unsafe fn syscall0(nr: SyscallNumber<'_>) -> RetReg<R0> {
- rustix_syscall0_nr_last_fastcall(nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> RetReg<R0> {
- rustix_syscall1_nr_last_fastcall(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall1_noreturn(nr: SyscallNumber<'_>, a0: ArgReg<'_, A0>) -> ! {
- rustix_syscall1_noreturn_nr_last_fastcall(a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall2(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
-) -> RetReg<R0> {
- rustix_syscall2_nr_last_fastcall(a1, a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall3(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
-) -> RetReg<R0> {
- rustix_syscall3_nr_last_fastcall(a1, a2, a0, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall4(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
-) -> RetReg<R0> {
- rustix_syscall4_nr_last_fastcall(a1, a2, a0, a3, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall5(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
-) -> RetReg<R0> {
- rustix_syscall5_nr_last_fastcall(a1, a2, a0, a3, a4, nr)
-}
-#[inline]
-pub(in crate::backend) unsafe fn syscall6(
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
-) -> RetReg<R0> {
- rustix_syscall6_nr_last_fastcall(a1, a2, a0, a3, a4, a5, nr)
-}
-
-// Then we define the `_readonly` versions of the wrappers. We don't have
-// separate `_readonly` implementations, so these can just be aliases to
-// their non-`_readonly` counterparts.
-pub(in crate::backend) use {
- syscall0 as syscall0_readonly, syscall1 as syscall1_readonly, syscall2 as syscall2_readonly,
- syscall3 as syscall3_readonly, syscall4 as syscall4_readonly, syscall5 as syscall5_readonly,
- syscall6 as syscall6_readonly,
-};
-
-// x86 prefers to route all syscalls through the vDSO, though this isn't
-// always possible, so it also has a special form for doing the dispatch.
-//
-// First we declare the actual assembly routines with `*_nr_last_fastcall`
-// names and reordered arguments. If the signatures or calling conventions are
-// ever changed, the symbol names should also be updated accordingly, to avoid
-// collisions with other versions of this crate.
-extern "fastcall" {
- fn rustix_indirect_syscall0_nr_last_fastcall(
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall1_nr_last_fastcall(
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall1_noreturn_nr_last_fastcall(
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> !;
- fn rustix_indirect_syscall2_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall3_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall4_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall5_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
- fn rustix_indirect_syscall6_nr_last_fastcall(
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a0: ArgReg<'_, A0>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
- nr: SyscallNumber<'_>,
- callee: SyscallType,
- ) -> RetReg<R0>;
-}
-
-// Then we define inline wrapper functions that do the reordering.
-
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall0(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
-) -> RetReg<R0> {
- rustix_indirect_syscall0_nr_last_fastcall(nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall1(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
-) -> RetReg<R0> {
- rustix_indirect_syscall1_nr_last_fastcall(a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall1_noreturn(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
-) -> ! {
- rustix_indirect_syscall1_noreturn_nr_last_fastcall(a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall2(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
-) -> RetReg<R0> {
- rustix_indirect_syscall2_nr_last_fastcall(a1, a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall3(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
-) -> RetReg<R0> {
- rustix_indirect_syscall3_nr_last_fastcall(a1, a2, a0, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall4(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
-) -> RetReg<R0> {
- rustix_indirect_syscall4_nr_last_fastcall(a1, a2, a0, a3, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall5(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
-) -> RetReg<R0> {
- rustix_indirect_syscall5_nr_last_fastcall(a1, a2, a0, a3, a4, nr, callee)
-}
-#[inline]
-pub(in crate::backend) unsafe fn indirect_syscall6(
- callee: SyscallType,
- nr: SyscallNumber<'_>,
- a0: ArgReg<'_, A0>,
- a1: ArgReg<'_, A1>,
- a2: ArgReg<'_, A2>,
- a3: ArgReg<'_, A3>,
- a4: ArgReg<'_, A4>,
- a5: ArgReg<'_, A5>,
-) -> RetReg<R0> {
- rustix_indirect_syscall6_nr_last_fastcall(a1, a2, a0, a3, a4, a5, nr, callee)
-}
diff --git a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.s b/vendor/rustix/src/backend/linux_raw/arch/outline/x86.s
deleted file mode 100644
index bda234e1a..000000000
--- a/vendor/rustix/src/backend/linux_raw/arch/outline/x86.s
+++ /dev/null
@@ -1,381 +0,0 @@
-// Assembly code for making x86 syscalls.
-//
-// On x86 we use the "fastcall" convention which passes the first two
-// arguments in ecx and edx. Outline.rs reorders the arguments to put
-// a1 and a2 in those registers so they we don't have to move them to
-// set up the kernel convention.
-//
-// "fastcall" expects callee to pop argument stack space, so we use
-// `ret imm` instructions to clean up the stack. We don't need callee
-// cleanup per se, it just comes along with using "fastcall".
-
- .file "x86.s"
- .intel_syntax noprefix
-
- .section .text.rustix_indirect_syscall0_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall0_nr_last_fastcall
- .hidden rustix_indirect_syscall0_nr_last_fastcall
- .type rustix_indirect_syscall0_nr_last_fastcall, @function
-rustix_indirect_syscall0_nr_last_fastcall:
- .cfi_startproc
- mov eax,ecx
- call edx
- ret
- .cfi_endproc
- .size rustix_indirect_syscall0_nr_last_fastcall, .-rustix_indirect_syscall0_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall1_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall1_nr_last_fastcall
- .hidden rustix_indirect_syscall1_nr_last_fastcall
- .type rustix_indirect_syscall1_nr_last_fastcall, @function
-rustix_indirect_syscall1_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,ecx
- mov eax,edx
- call DWORD PTR [esp+0x8]
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x4
- .cfi_endproc
- .size rustix_indirect_syscall1_nr_last_fastcall, .-rustix_indirect_syscall1_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall1_noreturn_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall1_noreturn_nr_last_fastcall
- .hidden rustix_indirect_syscall1_noreturn_nr_last_fastcall
- .type rustix_indirect_syscall1_noreturn_nr_last_fastcall, @function
-rustix_indirect_syscall1_noreturn_nr_last_fastcall:
- .cfi_startproc
- mov ebx,ecx
- mov eax,edx
- call DWORD PTR [esp+0x4]
- ud2
- .cfi_endproc
- .size rustix_indirect_syscall1_noreturn_nr_last_fastcall, .-rustix_indirect_syscall1_noreturn_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall2_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall2_nr_last_fastcall
- .hidden rustix_indirect_syscall2_nr_last_fastcall
- .type rustix_indirect_syscall2_nr_last_fastcall, @function
-rustix_indirect_syscall2_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,edx
- mov eax,DWORD PTR [esp+0x8]
- call DWORD PTR [esp+0xc]
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x8
- .cfi_endproc
- .size rustix_indirect_syscall2_nr_last_fastcall, .-rustix_indirect_syscall2_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall3_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall3_nr_last_fastcall
- .hidden rustix_indirect_syscall3_nr_last_fastcall
- .type rustix_indirect_syscall3_nr_last_fastcall, @function
-rustix_indirect_syscall3_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x8]
- mov eax,DWORD PTR [esp+0xc]
- call DWORD PTR [esp+0x10]
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0xc
- .cfi_endproc
- .size rustix_indirect_syscall3_nr_last_fastcall, .-rustix_indirect_syscall3_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall4_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall4_nr_last_fastcall
- .hidden rustix_indirect_syscall4_nr_last_fastcall
- .type rustix_indirect_syscall4_nr_last_fastcall, @function
-rustix_indirect_syscall4_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0xc]
- mov esi,DWORD PTR [esp+0x10]
- mov eax,DWORD PTR [esp+0x14]
- call DWORD PTR [esp+0x18]
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x10
- .cfi_endproc
- .size rustix_indirect_syscall4_nr_last_fastcall, .-rustix_indirect_syscall4_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall5_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall5_nr_last_fastcall
- .hidden rustix_indirect_syscall5_nr_last_fastcall
- .type rustix_indirect_syscall5_nr_last_fastcall, @function
-rustix_indirect_syscall5_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- push edi
- .cfi_def_cfa_offset 16
- .cfi_offset edi, -16
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x10]
- mov esi,DWORD PTR [esp+0x14]
- mov edi,DWORD PTR [esp+0x18]
- mov eax,DWORD PTR [esp+0x1c]
- call DWORD PTR [esp+0x20]
- pop edi
- .cfi_def_cfa_offset 12
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x14
- .cfi_endproc
- .size rustix_indirect_syscall5_nr_last_fastcall, .-rustix_indirect_syscall5_nr_last_fastcall
-
- .section .text.rustix_indirect_syscall6_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_indirect_syscall6_nr_last_fastcall
- .hidden rustix_indirect_syscall6_nr_last_fastcall
- .type rustix_indirect_syscall6_nr_last_fastcall, @function
-rustix_indirect_syscall6_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- push edi
- .cfi_def_cfa_offset 16
- push ebp
- .cfi_def_cfa_offset 20
- .cfi_offset ebp, -20
- .cfi_offset edi, -16
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x14]
- mov esi,DWORD PTR [esp+0x18]
- mov edi,DWORD PTR [esp+0x1c]
- mov ebp,DWORD PTR [esp+0x20]
- mov eax,DWORD PTR [esp+0x24]
- call DWORD PTR [esp+0x28]
- pop ebp
- .cfi_def_cfa_offset 16
- pop edi
- .cfi_def_cfa_offset 12
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x18
- .cfi_endproc
- .size rustix_indirect_syscall6_nr_last_fastcall, .-rustix_indirect_syscall6_nr_last_fastcall
-
- .section .text.rustix_syscall0_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall0_nr_last_fastcall
- .hidden rustix_syscall0_nr_last_fastcall
- .type rustix_syscall0_nr_last_fastcall, @function
-rustix_syscall0_nr_last_fastcall:
- .cfi_startproc
- mov eax,ecx
- int 0x80
- ret
- .cfi_endproc
- .size rustix_syscall0_nr_last_fastcall, .-rustix_syscall0_nr_last_fastcall
-
- .section .text.rustix_syscall1_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall1_nr_last_fastcall
- .hidden rustix_syscall1_nr_last_fastcall
- .type rustix_syscall1_nr_last_fastcall, @function
-rustix_syscall1_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov eax,edx
- mov ebx,ecx
- int 0x80
- pop ebx
- .cfi_def_cfa_offset 4
- ret
- .cfi_endproc
- .size rustix_syscall1_nr_last_fastcall, .-rustix_syscall1_nr_last_fastcall
-
- .section .text.rustix_syscall1_noreturn_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall1_noreturn_nr_last_fastcall
- .hidden rustix_syscall1_noreturn_nr_last_fastcall
- .type rustix_syscall1_noreturn_nr_last_fastcall, @function
-rustix_syscall1_noreturn_nr_last_fastcall:
- .cfi_startproc
- mov eax,edx
- mov ebx,ecx
- int 0x80
- ud2
- .cfi_endproc
- .size rustix_syscall1_noreturn_nr_last_fastcall, .-rustix_syscall1_noreturn_nr_last_fastcall
-
- .section .text.rustix_syscall2_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall2_nr_last_fastcall
- .hidden rustix_syscall2_nr_last_fastcall
- .type rustix_syscall2_nr_last_fastcall, @function
-rustix_syscall2_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,edx
- mov eax,DWORD PTR [esp+0x8]
- int 0x80
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x4
- .cfi_endproc
- .size rustix_syscall2_nr_last_fastcall, .-rustix_syscall2_nr_last_fastcall
-
- .section .text.rustix_syscall3_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall3_nr_last_fastcall
- .hidden rustix_syscall3_nr_last_fastcall
- .type rustix_syscall3_nr_last_fastcall, @function
-rustix_syscall3_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x8]
- mov eax,DWORD PTR [esp+0xc]
- int 0x80
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x8
- .cfi_endproc
- .size rustix_syscall3_nr_last_fastcall, .-rustix_syscall3_nr_last_fastcall
-
- .section .text.rustix_syscall4_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall4_nr_last_fastcall
- .hidden rustix_syscall4_nr_last_fastcall
- .type rustix_syscall4_nr_last_fastcall, @function
-rustix_syscall4_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push esi
- .cfi_def_cfa_offset 12
- .cfi_offset esi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0xc]
- mov esi,DWORD PTR [esp+0x10]
- mov eax,DWORD PTR [esp+0x14]
- int 0x80
- pop esi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0xc
- .cfi_endproc
- .size rustix_syscall4_nr_last_fastcall, .-rustix_syscall4_nr_last_fastcall
-
- .section .text.rustix_syscall5_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall5_nr_last_fastcall
- .hidden rustix_syscall5_nr_last_fastcall
- .type rustix_syscall5_nr_last_fastcall, @function
-rustix_syscall5_nr_last_fastcall:
- .cfi_startproc
- push ebx
- .cfi_def_cfa_offset 8
- push edi
- .cfi_def_cfa_offset 12
- push esi
- .cfi_def_cfa_offset 16
- .cfi_offset esi, -16
- .cfi_offset edi, -12
- .cfi_offset ebx, -8
- mov ebx,DWORD PTR [esp+0x10]
- mov esi,DWORD PTR [esp+0x14]
- mov edi,DWORD PTR [esp+0x18]
- mov eax,DWORD PTR [esp+0x1c]
- int 0x80
- pop esi
- .cfi_def_cfa_offset 12
- pop edi
- .cfi_def_cfa_offset 8
- pop ebx
- .cfi_def_cfa_offset 4
- ret 0x10
- .cfi_endproc
- .size rustix_syscall5_nr_last_fastcall, .-rustix_syscall5_nr_last_fastcall
-
- .section .text.rustix_syscall6_nr_last_fastcall,"ax",@progbits
- .p2align 4
- .weak rustix_syscall6_nr_last_fastcall
- .hidden rustix_syscall6_nr_last_fastcall
- .type rustix_syscall6_nr_last_fastcall, @function
-rustix_syscall6_nr_last_fastcall:
- .cfi_startproc
- push ebp
- .cfi_def_cfa_offset 8
- push ebx
- .cfi_def_cfa_offset 12
- push edi
- .cfi_def_cfa_offset 16
- push esi
- .cfi_def_cfa_offset 20
- .cfi_offset esi, -20
- .cfi_offset edi, -16
- .cfi_offset ebx, -12
- .cfi_offset ebp, -8
- mov ebx,DWORD PTR [esp+0x14]
- mov esi,DWORD PTR [esp+0x18]
- mov edi,DWORD PTR [esp+0x1c]
- mov ebp,DWORD PTR [esp+0x20]
- mov eax,DWORD PTR [esp+0x24]
- int 0x80
- pop esi
- .cfi_def_cfa_offset 16
- pop edi
- .cfi_def_cfa_offset 12
- pop ebx
- .cfi_def_cfa_offset 8
- pop ebp
- .cfi_def_cfa_offset 4
- ret 0x14
- .cfi_endproc
- .size rustix_syscall6_nr_last_fastcall, .-rustix_syscall6_nr_last_fastcall
-
- .section .text.rustix_int_0x80,"ax",@progbits
- .p2align 4
- .weak rustix_int_0x80
- .hidden rustix_int_0x80
- .type rustix_int_0x80, @function
-rustix_int_0x80:
- .cfi_startproc
- int 0x80
- ret
- .cfi_endproc
- .size rustix_int_0x80, .-rustix_int_0x80
-
- .section .note.GNU-stack,"",@progbits
diff --git a/vendor/rustix/src/backend/linux_raw/c.rs b/vendor/rustix/src/backend/linux_raw/c.rs
index 8e77c82d7..f336392bb 100644
--- a/vendor/rustix/src/backend/linux_raw/c.rs
+++ b/vendor/rustix/src/backend/linux_raw/c.rs
@@ -104,7 +104,15 @@ pub(crate) use linux_raw_sys::{
// On MIPS, `TCSANOW` et al have `TCSETS` added to them, so we need it to
// subtract it out.
-#[cfg(all(feature = "termios", any(target_arch = "mips", target_arch = "mips64")))]
+#[cfg(all(
+ feature = "termios",
+ any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )
+))]
pub(crate) use linux_raw_sys::ioctl::TCSETS;
// Define our own `uid_t` and `gid_t` if the kernel's versions are not 32-bit.
@@ -134,7 +142,9 @@ pub(crate) const SIGALRM: c_int = linux_raw_sys::general::SIGALRM as _;
pub(crate) const SIGTERM: c_int = linux_raw_sys::general::SIGTERM as _;
#[cfg(not(any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
)))]
@@ -156,7 +166,9 @@ pub(crate) const SIGPWR: c_int = linux_raw_sys::general::SIGPWR as _;
pub(crate) const SIGSYS: c_int = linux_raw_sys::general::SIGSYS as _;
#[cfg(any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
))]
diff --git a/vendor/rustix/src/backend/linux_raw/conv.rs b/vendor/rustix/src/backend/linux_raw/conv.rs
index 05d040204..c87136f8f 100644
--- a/vendor/rustix/src/backend/linux_raw/conv.rs
+++ b/vendor/rustix/src/backend/linux_raw/conv.rs
@@ -436,19 +436,79 @@ pub(crate) mod fs {
c_uint(access.bits())
}
}
+}
- impl<'a, Num: ArgNumber> From<crate::backend::fs::types::MountFlagsArg> for ArgReg<'a, Num> {
- #[inline]
- fn from(flags: crate::backend::fs::types::MountFlagsArg) -> Self {
- c_uint(flags.0)
- }
+#[cfg(any(feature = "fs", feature = "mount"))]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MountFlagsArg> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::MountFlagsArg) -> Self {
+ c_uint(flags.0)
}
+}
- impl<'a, Num: ArgNumber> From<crate::backend::fs::types::UnmountFlags> for ArgReg<'a, Num> {
- #[inline]
- fn from(flags: crate::backend::fs::types::UnmountFlags) -> Self {
- c_uint(flags.bits())
- }
+// When the deprecated "fs" aliases are removed, we can remove the "fs"
+// here too.
+#[cfg(any(feature = "fs", feature = "mount"))]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::UnmountFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::UnmountFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::mount::FsConfigCmd> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(cmd: crate::mount::FsConfigCmd) -> Self {
+ c_uint(cmd as c::c_uint)
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::FsOpenFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::FsOpenFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::FsMountFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::FsMountFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MountAttrFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::MountAttrFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::OpenTreeFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::OpenTreeFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::FsPickFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::FsPickFlags) -> Self {
+ c_uint(flags.bits())
+ }
+}
+
+#[cfg(feature = "mount")]
+impl<'a, Num: ArgNumber> From<crate::backend::mount::types::MoveMountFlags> for ArgReg<'a, Num> {
+ #[inline]
+ fn from(flags: crate::backend::mount::types::MoveMountFlags) -> Self {
+ c_uint(flags.bits())
}
}
diff --git a/vendor/rustix/src/backend/linux_raw/elf.rs b/vendor/rustix/src/backend/linux_raw/elf.rs
index 7797f4e21..415f79f88 100644
--- a/vendor/rustix/src/backend/linux_raw/elf.rs
+++ b/vendor/rustix/src/backend/linux_raw/elf.rs
@@ -62,7 +62,12 @@ pub(super) const EM_CURRENT: u16 = 40; // EM_ARM
pub(super) const EM_CURRENT: u16 = 3; // EM_386
#[cfg(target_arch = "powerpc64")]
pub(super) const EM_CURRENT: u16 = 21; // EM_PPC64
-#[cfg(any(target_arch = "mips", target_arch = "mips64"))]
+#[cfg(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
pub(super) const EM_CURRENT: u16 = 8; // EM_MIPS
#[cfg(target_arch = "x86_64")]
pub(super) const EM_CURRENT: u16 = 62; // EM_X86_64
diff --git a/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs b/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs
index 78a2088b2..b3d4cd66c 100644
--- a/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/fs/syscalls.rs
@@ -18,6 +18,7 @@ use crate::backend::conv::{loff_t, loff_t_from_u64, ret_u64};
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_pointer_width = "32",
))]
use crate::fd::AsFd;
@@ -32,7 +33,7 @@ use crate::fs::{
};
use crate::io;
use core::mem::{transmute, zeroed, MaybeUninit};
-#[cfg(target_arch = "mips64")]
+#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
use linux_raw_sys::general::stat as linux_stat64;
use linux_raw_sys::general::{
__kernel_fsid_t, __kernel_timespec, open_how, statx, AT_EACCESS, AT_FDCWD, AT_REMOVEDIR,
@@ -206,9 +207,9 @@ pub(crate) fn seek(fd: BorrowedFd<'_>, pos: SeekFrom) -> io::Result<u64> {
}
SeekFrom::End(offset) => (SEEK_END, offset),
SeekFrom::Current(offset) => (SEEK_CUR, offset),
- #[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
+ #[cfg(target_os = "linux")]
SeekFrom::Data(offset) => (SEEK_DATA, offset),
- #[cfg(any(freebsdlike, target_os = "linux", target_os = "solaris"))]
+ #[cfg(target_os = "linux")]
SeekFrom::Hole(offset) => (SEEK_HOLE, offset),
};
_seek(fd, offset, whence)
@@ -252,7 +253,12 @@ pub(crate) fn ftruncate(fd: BorrowedFd<'_>, length: u64) -> io::Result<()> {
// <https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/arm64/kernel/sys32.c#L81-L83>
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "powerpc"
+ ),
))]
unsafe {
ret(syscall_readonly!(
@@ -265,7 +271,12 @@ pub(crate) fn ftruncate(fd: BorrowedFd<'_>, length: u64) -> io::Result<()> {
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "powerpc"
+ )),
))]
unsafe {
ret(syscall_readonly!(
@@ -348,7 +359,7 @@ pub(crate) fn fadvise(fd: BorrowedFd<'_>, pos: u64, len: u64, advice: Advice) ->
}
// On mips, the arguments are not reordered, and padding is inserted
// instead to ensure alignment.
- #[cfg(target_arch = "mips")]
+ #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
unsafe {
ret(syscall_readonly!(
__NR_fadvise64,
@@ -363,7 +374,12 @@ pub(crate) fn fadvise(fd: BorrowedFd<'_>, pos: u64, len: u64, advice: Advice) ->
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "powerpc")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "powerpc"
+ )),
))]
unsafe {
ret(syscall_readonly!(
@@ -427,7 +443,11 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
// And, some old platforms don't support `statx`, and some fail with a
// confusing error code, so we call `crate::fs::statx` to handle that. If
// `statx` isn't available, fall back to the buggy system call.
- #[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+ #[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
match crate::fs::statx(fd, cstr!(""), AtFlags::EMPTY_PATH, StatxFlags::BASIC_STATS) {
Ok(x) => statx_to_stat(x),
@@ -436,7 +456,11 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
}
}
- #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+ #[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6")
+ ))]
unsafe {
let mut result = MaybeUninit::<Stat>::uninit();
ret(syscall!(__NR_fstat, fd, &mut result))?;
@@ -444,11 +468,15 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
}
}
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6",
+))]
fn fstat_old(fd: BorrowedFd<'_>) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(__NR_fstat, fd, &mut result))?;
stat_to_stat(result.assume_init())
@@ -464,7 +492,11 @@ fn fstat_old(fd: BorrowedFd<'_>) -> io::Result<Stat> {
#[inline]
pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+ #[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
match crate::fs::statx(
crate::fs::CWD.as_fd(),
@@ -478,7 +510,11 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
}
}
- #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+ #[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6"),
+ ))]
unsafe {
let mut result = MaybeUninit::<Stat>::uninit();
ret(syscall!(
@@ -492,11 +528,15 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
}
}
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
fn stat_old(path: &CStr) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(
__NR_newfstatat,
@@ -524,7 +564,11 @@ fn stat_old(path: &CStr) -> io::Result<Stat> {
#[inline]
pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
// See the comments in `fstat` about using `crate::fs::statx` here.
- #[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+ #[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
match crate::fs::statx(dirfd, path, flags, StatxFlags::BASIC_STATS) {
Ok(x) => statx_to_stat(x),
@@ -533,7 +577,11 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
}
}
- #[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+ #[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6"),
+ ))]
unsafe {
let mut result = MaybeUninit::<Stat>::uninit();
ret(syscall!(__NR_newfstatat, dirfd, path, &mut result, flags))?;
@@ -541,11 +589,15 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
}
}
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
fn statat_old(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(__NR_newfstatat, dirfd, path, &mut result, flags))?;
stat_to_stat(result.assume_init())
@@ -593,7 +645,7 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
fn lstat_old(path: &CStr) -> io::Result<Stat> {
let mut result = MaybeUninit::<linux_stat64>::uninit();
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
unsafe {
ret(syscall!(
__NR_newfstatat,
@@ -619,7 +671,11 @@ fn lstat_old(path: &CStr) -> io::Result<Stat> {
}
/// Convert from a Linux `statx` value to rustix's `Stat`.
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
fn statx_to_stat(x: crate::fs::Statx) -> io::Result<Stat> {
Ok(Stat {
st_dev: crate::fs::makedev(x.stx_dev_major, x.stx_dev_minor),
@@ -686,7 +742,7 @@ fn stat_to_stat(s64: linux_raw_sys::general::stat64) -> io::Result<Stat> {
}
/// Convert from a Linux `stat` value to rustix's `Stat`.
-#[cfg(target_arch = "mips64")]
+#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
fn stat_to_stat(s: linux_raw_sys::general::stat) -> io::Result<Stat> {
Ok(Stat {
st_dev: s.st_dev.try_into().map_err(|_| io::Errno::OVERFLOW)?,
@@ -1417,31 +1473,6 @@ pub(crate) fn sendfile(
}
#[inline]
-pub(crate) fn mount(
- source: Option<&CStr>,
- target: &CStr,
- file_system_type: Option<&CStr>,
- flags: super::types::MountFlagsArg,
- data: Option<&CStr>,
-) -> io::Result<()> {
- unsafe {
- ret(syscall_readonly!(
- __NR_mount,
- source,
- target,
- file_system_type,
- flags,
- data
- ))
- }
-}
-
-#[inline]
-pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {
- unsafe { ret(syscall_readonly!(__NR_umount2, target, flags)) }
-}
-
-#[inline]
pub(crate) fn inotify_init1(flags: inotify::CreateFlags) -> io::Result<OwnedFd> {
unsafe { ret_owned_fd(syscall_readonly!(__NR_inotify_init1, flags)) }
}
diff --git a/vendor/rustix/src/backend/linux_raw/fs/types.rs b/vendor/rustix/src/backend/linux_raw/fs/types.rs
index df61cf721..e18dc0b4d 100644
--- a/vendor/rustix/src/backend/linux_raw/fs/types.rs
+++ b/vendor/rustix/src/backend/linux_raw/fs/types.rs
@@ -600,7 +600,11 @@ pub enum FlockOperation {
// On 32-bit, and mips64, Linux's `struct stat64` has a 32-bit `st_mtime` and
// friends, so we use our own struct, populated from `statx` where possible, to
// avoid the y2038 bug.
-#[cfg(any(target_pointer_width = "32", target_arch = "mips64"))]
+#[cfg(any(
+ target_pointer_width = "32",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[allow(missing_docs)]
@@ -627,7 +631,11 @@ pub struct Stat {
///
/// [`statat`]: crate::fs::statat
/// [`fstat`]: crate::fs::fstat
-#[cfg(all(target_pointer_width = "64", not(target_arch = "mips64")))]
+#[cfg(all(
+ target_pointer_width = "64",
+ not(target_arch = "mips64"),
+ not(target_arch = "mips64r6")
+))]
pub type Stat = linux_raw_sys::general::stat;
/// `struct statfs` for use with [`statfs`] and [`fstatfs`].
@@ -688,117 +696,9 @@ pub type RawMode = c::c_uint;
pub type Dev = u64;
/// `__fsword_t`
-#[cfg(not(target_arch = "mips64"))]
+#[cfg(not(any(target_arch = "mips64", target_arch = "mips64r6")))]
pub type FsWord = linux_raw_sys::general::__fsword_t;
/// `__fsword_t`
-#[cfg(target_arch = "mips64")]
+#[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
pub type FsWord = i64;
-
-bitflags! {
- /// `MS_*` constants for use with [`mount`].
- ///
- /// [`mount`]: crate::fs::mount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MountFlags: c::c_uint {
- /// `MS_BIND`
- const BIND = linux_raw_sys::general::MS_BIND;
-
- /// `MS_DIRSYNC`
- const DIRSYNC = linux_raw_sys::general::MS_DIRSYNC;
-
- /// `MS_LAZYTIME`
- const LAZYTIME = linux_raw_sys::general::MS_LAZYTIME;
-
- /// `MS_MANDLOCK`
- #[doc(alias = "MANDLOCK")]
- const PERMIT_MANDATORY_FILE_LOCKING = linux_raw_sys::general::MS_MANDLOCK;
-
- /// `MS_NOATIME`
- const NOATIME = linux_raw_sys::general::MS_NOATIME;
-
- /// `MS_NODEV`
- const NODEV = linux_raw_sys::general::MS_NODEV;
-
- /// `MS_NODIRATIME`
- const NODIRATIME = linux_raw_sys::general::MS_NODIRATIME;
-
- /// `MS_NOEXEC`
- const NOEXEC = linux_raw_sys::general::MS_NOEXEC;
-
- /// `MS_NOSUID`
- const NOSUID = linux_raw_sys::general::MS_NOSUID;
-
- /// `MS_RDONLY`
- const RDONLY = linux_raw_sys::general::MS_RDONLY;
-
- /// `MS_REC`
- const REC = linux_raw_sys::general::MS_REC;
-
- /// `MS_RELATIME`
- const RELATIME = linux_raw_sys::general::MS_RELATIME;
-
- /// `MS_SILENT`
- const SILENT = linux_raw_sys::general::MS_SILENT;
-
- /// `MS_STRICTATIME`
- const STRICTATIME = linux_raw_sys::general::MS_STRICTATIME;
-
- /// `MS_SYNCHRONOUS`
- const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS;
-
- /// `MS_NOSYMFOLLOW`
- const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW;
- }
-}
-
-bitflags! {
- /// `MS_*` constants for use with [`change_mount`].
- ///
- /// [`change_mount`]: crate::fs::mount::change_mount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MountPropagationFlags: c::c_uint {
- /// `MS_SHARED`
- const SHARED = linux_raw_sys::general::MS_SHARED;
- /// `MS_PRIVATE`
- const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
- /// `MS_SLAVE`
- const SLAVE = linux_raw_sys::general::MS_SLAVE;
- /// `MS_UNBINDABLE`
- const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
- /// `MS_REC`
- const REC = linux_raw_sys::general::MS_REC;
- }
-}
-
-bitflags! {
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub(crate) struct InternalMountFlags: c::c_uint {
- const REMOUNT = linux_raw_sys::general::MS_REMOUNT;
- const MOVE = linux_raw_sys::general::MS_MOVE;
- }
-}
-
-#[repr(transparent)]
-pub(crate) struct MountFlagsArg(pub(crate) c::c_uint);
-
-bitflags! {
- /// `MNT_*` constants for use with [`unmount`].
- ///
- /// [`unmount`]: crate::fs::mount::unmount
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct UnmountFlags: c::c_uint {
- /// `MNT_FORCE`
- const FORCE = linux_raw_sys::general::MNT_FORCE;
- /// `MNT_DETACH`
- const DETACH = linux_raw_sys::general::MNT_DETACH;
- /// `MNT_EXPIRE`
- const EXPIRE = linux_raw_sys::general::MNT_EXPIRE;
- /// `UMOUNT_NOFOLLOW`
- const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW;
- }
-}
diff --git a/vendor/rustix/src/backend/linux_raw/io/syscalls.rs b/vendor/rustix/src/backend/linux_raw/io/syscalls.rs
index 45e0dd647..88eed3d72 100644
--- a/vendor/rustix/src/backend/linux_raw/io/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/io/syscalls.rs
@@ -10,7 +10,12 @@
use crate::backend::conv::loff_t_from_u64;
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "power"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ ),
))]
use crate::backend::conv::zero;
use crate::backend::conv::{
@@ -26,8 +31,6 @@ use crate::io::{self, DupFlags, FdFlags, IoSlice, IoSliceMut, ReadWriteFlags};
use crate::net::{RecvFlags, SendFlags};
use core::cmp;
use core::mem::MaybeUninit;
-#[cfg(target_os = "espidf")]
-use linux_raw_sys::general::F_DUPFD;
use linux_raw_sys::general::{F_DUPFD_CLOEXEC, F_GETFD, F_SETFD};
use linux_raw_sys::ioctl::{FIONBIO, FIONREAD};
@@ -45,7 +48,12 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], pos: u64) -> io::Result<
// <https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/arm64/kernel/sys32.c#L75>
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "power"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ ),
))]
unsafe {
ret_usize(syscall!(
@@ -60,7 +68,12 @@ pub(crate) fn pread(fd: BorrowedFd<'_>, buf: &mut [u8], pos: u64) -> io::Result<
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "power")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ )),
))]
unsafe {
ret_usize(syscall!(
@@ -170,7 +183,12 @@ pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], pos: u64) -> io::Result<usi
// <https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/arm64/kernel/sys32.c#L81-L83>
#[cfg(all(
target_pointer_width = "32",
- any(target_arch = "arm", target_arch = "mips", target_arch = "power"),
+ any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ ),
))]
unsafe {
ret_usize(syscall_readonly!(
@@ -185,7 +203,12 @@ pub(crate) fn pwrite(fd: BorrowedFd<'_>, buf: &[u8], pos: u64) -> io::Result<usi
}
#[cfg(all(
target_pointer_width = "32",
- not(any(target_arch = "arm", target_arch = "mips", target_arch = "power")),
+ not(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "power"
+ )),
))]
unsafe {
ret_usize(syscall_readonly!(
@@ -339,10 +362,7 @@ pub(crate) fn is_read_write(fd: BorrowedFd<'_>) -> io::Result<(bool, bool)> {
// the write side is shut down.
#[allow(unreachable_patterns)] // `EAGAIN` equals `EWOULDBLOCK`
match crate::backend::net::syscalls::send(fd, &[], SendFlags::DONTWAIT) {
- // TODO or-patterns when we don't need 1.51
- Err(io::Errno::AGAIN) => (),
- Err(io::Errno::WOULDBLOCK) => (),
- Err(io::Errno::NOTSOCK) => (),
+ Err(io::Errno::AGAIN | io::Errno::WOULDBLOCK | io::Errno::NOTSOCK) => (),
Err(io::Errno::PIPE) => write = false,
Err(err) => return Err(err),
Ok(_) => (),
@@ -403,29 +423,6 @@ pub(crate) fn fcntl_setfd(fd: BorrowedFd<'_>, flags: FdFlags) -> io::Result<()>
}
}
-#[cfg(target_os = "espidf")]
-#[inline]
-pub(crate) fn fcntl_dupfd(fd: BorrowedFd<'_>, min: RawFd) -> io::Result<OwnedFd> {
- #[cfg(target_pointer_width = "32")]
- unsafe {
- ret_owned_fd(syscall_readonly!(
- __NR_fcntl64,
- fd,
- c_uint(F_DUPFD),
- raw_fd(min)
- ))
- }
- #[cfg(target_pointer_width = "64")]
- unsafe {
- ret_owned_fd(syscall_readonly!(
- __NR_fcntl,
- fd,
- c_uint(F_DUPFD),
- raw_fd(min)
- ))
- }
-}
-
#[inline]
pub(crate) fn fcntl_dupfd_cloexec(fd: BorrowedFd<'_>, min: RawFd) -> io::Result<OwnedFd> {
#[cfg(target_pointer_width = "32")]
diff --git a/vendor/rustix/src/backend/linux_raw/mm/types.rs b/vendor/rustix/src/backend/linux_raw/mm/types.rs
index 576f08a3d..2d5eebc58 100644
--- a/vendor/rustix/src/backend/linux_raw/mm/types.rs
+++ b/vendor/rustix/src/backend/linux_raw/mm/types.rs
@@ -38,6 +38,20 @@ bitflags! {
const GROWSUP = linux_raw_sys::general::PROT_GROWSUP;
/// `PROT_GROWSDOWN`
const GROWSDOWN = linux_raw_sys::general::PROT_GROWSDOWN;
+ /// `PROT_SEM`
+ const SEM = linux_raw_sys::general::PROT_SEM;
+ /// `PROT_BTI`
+ #[cfg(target_arch = "aarch64")]
+ const BTI = linux_raw_sys::general::PROT_BTI;
+ /// `PROT_MTE`
+ #[cfg(target_arch = "aarch64")]
+ const MTE = linux_raw_sys::general::PROT_MTE;
+ /// `PROT_SAO`
+ #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
+ const SAO = linux_raw_sys::general::PROT_SAO;
+ /// `PROT_ADI`
+ #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))]
+ const ADI = linux_raw_sys::general::PROT_ADI;
}
}
@@ -80,10 +94,10 @@ bitflags! {
/// `MAP_STACK`
const STACK = linux_raw_sys::general::MAP_STACK;
/// `MAP_SYNC` (since Linux 4.15)
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6")))]
const SYNC = linux_raw_sys::general::MAP_SYNC;
/// `MAP_UNINITIALIZED`
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6")))]
const UNINITIALIZED = linux_raw_sys::general::MAP_UNINITIALIZED;
}
}
@@ -106,18 +120,6 @@ bitflags! {
}
bitflags! {
- /// `MLOCK_*` flags for use with [`mlock_with`].
- ///
- /// [`mlock_with`]: crate::io::mlock_with
- #[repr(transparent)]
- #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct MlockFlags: u32 {
- /// `MLOCK_ONFAULT`
- const ONFAULT = linux_raw_sys::general::MLOCK_ONFAULT;
- }
-}
-
-bitflags! {
/// `MS_*` flags for use with [`msync`].
///
/// [`msync`]: crate::io::msync
@@ -137,16 +139,14 @@ bitflags! {
}
bitflags! {
- /// `O_*` flags for use with [`userfaultfd`].
+ /// `MLOCK_*` flags for use with [`mlock_with`].
///
- /// [`userfaultfd`]: crate::io::userfaultfd
+ /// [`mlock_with`]: crate::io::mlock_with
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
- pub struct UserfaultfdFlags: c::c_uint {
- /// `O_CLOEXEC`
- const CLOEXEC = linux_raw_sys::general::O_CLOEXEC;
- /// `O_NONBLOCK`
- const NONBLOCK = linux_raw_sys::general::O_NONBLOCK;
+ pub struct MlockFlags: u32 {
+ /// `MLOCK_ONFAULT`
+ const ONFAULT = linux_raw_sys::general::MLOCK_ONFAULT;
}
}
@@ -183,7 +183,12 @@ pub enum Advice {
/// `MADV_HWPOISON`
LinuxHwPoison = linux_raw_sys::general::MADV_HWPOISON,
/// `MADV_SOFT_OFFLINE`
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )))]
LinuxSoftOffline = linux_raw_sys::general::MADV_SOFT_OFFLINE,
/// `MADV_MERGEABLE`
LinuxMergeable = linux_raw_sys::general::MADV_MERGEABLE,
@@ -222,3 +227,17 @@ impl Advice {
/// `LinuxDontNeed` for the Linux behavior.
pub const DontNeed: Self = Self::Normal;
}
+
+bitflags! {
+ /// `O_*` flags for use with [`userfaultfd`].
+ ///
+ /// [`userfaultfd`]: crate::io::userfaultfd
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct UserfaultfdFlags: c::c_uint {
+ /// `O_CLOEXEC`
+ const CLOEXEC = linux_raw_sys::general::O_CLOEXEC;
+ /// `O_NONBLOCK`
+ const NONBLOCK = linux_raw_sys::general::O_NONBLOCK;
+ }
+}
diff --git a/vendor/rustix/src/backend/linux_raw/mod.rs b/vendor/rustix/src/backend/linux_raw/mod.rs
index cd5805f88..c3018930f 100644
--- a/vendor/rustix/src/backend/linux_raw/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/mod.rs
@@ -51,6 +51,10 @@ pub(crate) mod io;
pub(crate) mod io_uring;
#[cfg(feature = "mm")]
pub(crate) mod mm;
+#[cfg(feature = "mount")]
+pub(crate) mod mount;
+#[cfg(all(feature = "fs", not(feature = "mount")))]
+pub(crate) mod mount; // for deprecated mount functions in "fs"
#[cfg(feature = "net")]
pub(crate) mod net;
#[cfg(any(
diff --git a/vendor/rustix/src/backend/linux_raw/mount/mod.rs b/vendor/rustix/src/backend/linux_raw/mount/mod.rs
new file mode 100644
index 000000000..1e0181a99
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/mount/mod.rs
@@ -0,0 +1,2 @@
+pub(crate) mod syscalls;
+pub(crate) mod types;
diff --git a/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs b/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs
new file mode 100644
index 000000000..77c2a181d
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/mount/syscalls.rs
@@ -0,0 +1,239 @@
+//! linux_raw syscalls supporting `rustix::mount`.
+//!
+//! # Safety
+//!
+//! See the `rustix::backend` module documentation for details.
+#![allow(unsafe_code)]
+#![allow(clippy::undocumented_unsafe_blocks)]
+
+use crate::backend::conv::ret;
+#[cfg(feature = "mount")]
+use crate::backend::conv::{ret_owned_fd, slice, zero};
+#[cfg(feature = "mount")]
+use crate::fd::{BorrowedFd, OwnedFd};
+use crate::ffi::CStr;
+use crate::io;
+
+#[inline]
+pub(crate) fn mount(
+ source: Option<&CStr>,
+ target: &CStr,
+ file_system_type: Option<&CStr>,
+ flags: super::types::MountFlagsArg,
+ data: Option<&CStr>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_mount,
+ source,
+ target,
+ file_system_type,
+ flags,
+ data
+ ))
+ }
+}
+
+#[inline]
+pub(crate) fn unmount(target: &CStr, flags: super::types::UnmountFlags) -> io::Result<()> {
+ unsafe { ret(syscall_readonly!(__NR_umount2, target, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsopen(fs_name: &CStr, flags: super::types::FsOpenFlags) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(syscall_readonly!(__NR_fsopen, fs_name, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsmount(
+ fs_fd: BorrowedFd<'_>,
+ flags: super::types::FsMountFlags,
+ attr_flags: super::types::MountAttrFlags,
+) -> io::Result<()> {
+ unsafe { ret(syscall_readonly!(__NR_fsmount, fs_fd, flags, attr_flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn move_mount(
+ from_dfd: BorrowedFd<'_>,
+ from_pathname: &CStr,
+ to_dfd: BorrowedFd<'_>,
+ to_pathname: &CStr,
+ flags: super::types::MoveMountFlags,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_move_mount,
+ from_dfd,
+ from_pathname,
+ to_dfd,
+ to_pathname,
+ flags
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn open_tree(
+ dfd: BorrowedFd<'_>,
+ filename: &CStr,
+ flags: super::types::OpenTreeFlags,
+) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(syscall_readonly!(__NR_open_tree, dfd, filename, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fspick(
+ dfd: BorrowedFd<'_>,
+ path: &CStr,
+ flags: super::types::FsPickFlags,
+) -> io::Result<OwnedFd> {
+ unsafe { ret_owned_fd(syscall_readonly!(__NR_fspick, dfd, path, flags)) }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_flag(fs_fd: BorrowedFd<'_>, key: &CStr) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetFlag,
+ key,
+ zero(),
+ zero()
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_string(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ value: &CStr,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetString,
+ key,
+ value,
+ zero()
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_binary(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ value: &[u8],
+) -> io::Result<()> {
+ let (value_addr, value_len) = slice(value);
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetBinary,
+ key,
+ value_addr,
+ value_len
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_fd(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetFd,
+ key,
+ zero(),
+ fd
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_path(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ path: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetPath,
+ key,
+ path,
+ fd
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_set_path_empty(
+ fs_fd: BorrowedFd<'_>,
+ key: &CStr,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::SetPathEmpty,
+ key,
+ cstr!(""),
+ fd
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_create(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::Create,
+ zero(),
+ zero(),
+ zero()
+ ))
+ }
+}
+
+#[cfg(feature = "mount")]
+#[inline]
+pub(crate) fn fsconfig_reconfigure(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ unsafe {
+ ret(syscall_readonly!(
+ __NR_fsconfig,
+ fs_fd,
+ super::types::FsConfigCmd::Reconfigure,
+ zero(),
+ zero(),
+ zero()
+ ))
+ }
+}
diff --git a/vendor/rustix/src/backend/linux_raw/mount/types.rs b/vendor/rustix/src/backend/linux_raw/mount/types.rs
new file mode 100644
index 000000000..808710c13
--- /dev/null
+++ b/vendor/rustix/src/backend/linux_raw/mount/types.rs
@@ -0,0 +1,303 @@
+use crate::backend::c;
+use bitflags::bitflags;
+
+bitflags! {
+ /// `MS_*` constants for use with [`mount`].
+ ///
+ /// [`mount`]: crate::mount::mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountFlags: c::c_uint {
+ /// `MS_BIND`
+ const BIND = linux_raw_sys::general::MS_BIND;
+
+ /// `MS_DIRSYNC`
+ const DIRSYNC = linux_raw_sys::general::MS_DIRSYNC;
+
+ /// `MS_LAZYTIME`
+ const LAZYTIME = linux_raw_sys::general::MS_LAZYTIME;
+
+ /// `MS_MANDLOCK`
+ #[doc(alias = "MANDLOCK")]
+ const PERMIT_MANDATORY_FILE_LOCKING = linux_raw_sys::general::MS_MANDLOCK;
+
+ /// `MS_NOATIME`
+ const NOATIME = linux_raw_sys::general::MS_NOATIME;
+
+ /// `MS_NODEV`
+ const NODEV = linux_raw_sys::general::MS_NODEV;
+
+ /// `MS_NODIRATIME`
+ const NODIRATIME = linux_raw_sys::general::MS_NODIRATIME;
+
+ /// `MS_NOEXEC`
+ const NOEXEC = linux_raw_sys::general::MS_NOEXEC;
+
+ /// `MS_NOSUID`
+ const NOSUID = linux_raw_sys::general::MS_NOSUID;
+
+ /// `MS_RDONLY`
+ const RDONLY = linux_raw_sys::general::MS_RDONLY;
+
+ /// `MS_REC`
+ const REC = linux_raw_sys::general::MS_REC;
+
+ /// `MS_RELATIME`
+ const RELATIME = linux_raw_sys::general::MS_RELATIME;
+
+ /// `MS_SILENT`
+ const SILENT = linux_raw_sys::general::MS_SILENT;
+
+ /// `MS_STRICTATIME`
+ const STRICTATIME = linux_raw_sys::general::MS_STRICTATIME;
+
+ /// `MS_SYNCHRONOUS`
+ const SYNCHRONOUS = linux_raw_sys::general::MS_SYNCHRONOUS;
+
+ /// `MS_NOSYMFOLLOW`
+ const NOSYMFOLLOW = linux_raw_sys::general::MS_NOSYMFOLLOW;
+ }
+}
+
+bitflags! {
+ /// `MNT_*` constants for use with [`unmount`].
+ ///
+ /// [`unmount`]: crate::mount::unmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct UnmountFlags: c::c_uint {
+ /// `MNT_FORCE`
+ const FORCE = linux_raw_sys::general::MNT_FORCE;
+ /// `MNT_DETACH`
+ const DETACH = linux_raw_sys::general::MNT_DETACH;
+ /// `MNT_EXPIRE`
+ const EXPIRE = linux_raw_sys::general::MNT_EXPIRE;
+ /// `UMOUNT_NOFOLLOW`
+ const NOFOLLOW = linux_raw_sys::general::UMOUNT_NOFOLLOW;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `FSOPEN_*` constants for use with [`fsopen`].
+ ///
+ /// [`fsopen`]: crate::mount::fsopen
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsOpenFlags: c::c_uint {
+
+ /// `FSOPEN_CLOEXEC`
+ const FSOPEN_CLOEXEC = linux_raw_sys::general::FSOPEN_CLOEXEC;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `FSMOUNT_*` constants for use with [`fsmount`].
+ ///
+ /// [`fsmount`]: crate::mount::fsmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsMountFlags: c::c_uint {
+ /// `FSMOUNT_CLOEXEC`
+ const FSMOUNT_CLOEXEC = linux_raw_sys::general::FSMOUNT_CLOEXEC;
+ }
+}
+
+/// `FSCONFIG_*` constants for use with the `fsconfig` syscall.
+#[cfg(feature = "mount")]
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+#[repr(u32)]
+pub(crate) enum FsConfigCmd {
+ /// `FSCONFIG_SET_FLAG`
+ SetFlag = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FLAG as u32,
+
+ /// `FSCONFIG_SET_STRING`
+ SetString = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_STRING as u32,
+
+ /// `FSCONFIG_SET_BINARY`
+ SetBinary = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_BINARY as u32,
+
+ /// `FSCONFIG_SET_PATH`
+ SetPath = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH as u32,
+
+ /// `FSCONFIG_SET_PATH_EMPTY`
+ SetPathEmpty = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_PATH_EMPTY as u32,
+
+ /// `FSCONFIG_SET_FD`
+ SetFd = linux_raw_sys::general::fsconfig_command::FSCONFIG_SET_FD as u32,
+
+ /// `FSCONFIG_CMD_CREATE`
+ Create = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_CREATE as u32,
+
+ /// `FSCONFIG_CMD_RECONFIGURE`
+ Reconfigure = linux_raw_sys::general::fsconfig_command::FSCONFIG_CMD_RECONFIGURE as u32,
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `MOUNT_ATTR_*` constants for use with [`fsmount`].
+ ///
+ /// [`fsmount`]: crate::mount::fsmount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountAttrFlags: c::c_uint {
+ /// `MOUNT_ATTR_RDONLY`
+ const MOUNT_ATTR_RDONLY = linux_raw_sys::general::MOUNT_ATTR_RDONLY;
+
+ /// `MOUNT_ATTR_NOSUID`
+ const MOUNT_ATTR_NOSUID = linux_raw_sys::general::MOUNT_ATTR_NOSUID;
+
+ /// `MOUNT_ATTR_NODEV`
+ const MOUNT_ATTR_NODEV = linux_raw_sys::general::MOUNT_ATTR_NODEV;
+
+ /// `MOUNT_ATTR_NOEXEC`
+ const MOUNT_ATTR_NOEXEC = linux_raw_sys::general::MOUNT_ATTR_NOEXEC;
+
+ /// `MOUNT_ATTR__ATIME`
+ const MOUNT_ATTR__ATIME = linux_raw_sys::general::MOUNT_ATTR__ATIME;
+
+ /// `MOUNT_ATTR_RELATIME`
+ const MOUNT_ATTR_RELATIME = linux_raw_sys::general::MOUNT_ATTR_RELATIME;
+
+ /// `MOUNT_ATTR_NOATIME`
+ const MOUNT_ATTR_NOATIME = linux_raw_sys::general::MOUNT_ATTR_NOATIME;
+
+ /// `MOUNT_ATTR_STRICTATIME`
+ const MOUNT_ATTR_STRICTATIME = linux_raw_sys::general::MOUNT_ATTR_STRICTATIME;
+
+ /// `MOUNT_ATTR_NODIRATIME`
+ const MOUNT_ATTR_NODIRATIME = linux_raw_sys::general::MOUNT_ATTR_NODIRATIME;
+
+ /// `MOUNT_ATTR_NOUSER`
+ const MOUNT_ATTR_IDMAP = linux_raw_sys::general::MOUNT_ATTR_IDMAP;
+
+ /// `MOUNT_ATTR__ATIME_FLAGS`
+ const MOUNT_ATTR_NOSYMFOLLOW = linux_raw_sys::general::MOUNT_ATTR_NOSYMFOLLOW;
+
+ /// `MOUNT_ATTR__ATIME_FLAGS`
+ const MOUNT_ATTR_SIZE_VER0 = linux_raw_sys::general::MOUNT_ATTR_SIZE_VER0;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `MOVE_MOUNT_*` constants for use with [`move_mount`].
+ ///
+ /// [`move_mount`]: crate::mount::move_mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MoveMountFlags: c::c_uint {
+ /// `MOVE_MOUNT_F_EMPTY_PATH`
+ const MOVE_MOUNT_F_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_F_SYMLINKS;
+
+ /// `MOVE_MOUNT_F_AUTOMOUNTS`
+ const MOVE_MOUNT_F_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_F_AUTOMOUNTS;
+
+ /// `MOVE_MOUNT_F_EMPTY_PATH`
+ const MOVE_MOUNT_F_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_F_EMPTY_PATH;
+
+ /// `MOVE_MOUNT_T_SYMLINKS`
+ const MOVE_MOUNT_T_SYMLINKS = linux_raw_sys::general::MOVE_MOUNT_T_SYMLINKS;
+
+ /// `MOVE_MOUNT_T_AUTOMOUNTS`
+ const MOVE_MOUNT_T_AUTOMOUNTS = linux_raw_sys::general::MOVE_MOUNT_T_AUTOMOUNTS;
+
+ /// `MOVE_MOUNT_T_EMPTY_PATH`
+ const MOVE_MOUNT_T_EMPTY_PATH = linux_raw_sys::general::MOVE_MOUNT_T_EMPTY_PATH;
+
+ /// `MOVE_MOUNT__MASK`
+ const MOVE_MOUNT_SET_GROUP = linux_raw_sys::general::MOVE_MOUNT_SET_GROUP;
+
+ // TODO: add when linux 6.5 is released
+ // /// `MOVE_MOUNT_BENEATH`
+ // const MOVE_MOUNT_BENEATH = linux_raw_sys::general::MOVE_MOUNT_BENEATH;
+
+ /// `MOVE_MOUNT__MASK`
+ const MOVE_MOUNT__MASK = linux_raw_sys::general::MOVE_MOUNT__MASK;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `OPENTREE_*` constants for use with [`open_tree`].
+ ///
+ /// [`open_tree`]: crate::mount::open_tree
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct OpenTreeFlags: c::c_uint {
+ /// `OPENTREE_CLONE`
+ const OPEN_TREE_CLONE = linux_raw_sys::general::OPEN_TREE_CLONE;
+
+ /// `OPENTREE_CLOEXEC`
+ const OPEN_TREE_CLOEXEC = linux_raw_sys::general::OPEN_TREE_CLOEXEC;
+
+ /// `AT_EMPTY_PATH`
+ const AT_EMPTY_PATH = linux_raw_sys::general::AT_EMPTY_PATH;
+
+ /// `AT_NO_AUTOMOUNT`
+ const AT_NO_AUTOMOUNT = linux_raw_sys::general::AT_NO_AUTOMOUNT;
+
+ /// `AT_RECURSIVE`
+ const AT_RECURSIVE = linux_raw_sys::general::AT_RECURSIVE;
+
+ /// `AT_SYMLINK_NOFOLLOW`
+ const AT_SYMLINK_NOFOLLOW = linux_raw_sys::general::AT_SYMLINK_NOFOLLOW;
+ }
+}
+
+#[cfg(feature = "mount")]
+bitflags! {
+ /// `FSPICK_*` constants for use with [`fspick`].
+ ///
+ /// [`fspick`]: crate::mount::fspick
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct FsPickFlags: c::c_uint {
+ /// `FSPICK_CLOEXEC`
+ const FSPICK_CLOEXEC = linux_raw_sys::general::FSPICK_CLOEXEC;
+
+ /// `FSPICK_SYMLINK_NOFOLLOW`
+ const FSPICK_SYMLINK_NOFOLLOW = linux_raw_sys::general::FSPICK_SYMLINK_NOFOLLOW;
+
+ /// `FSPICK_NO_AUTOMOUNT`
+ const FSPICK_NO_AUTOMOUNT = linux_raw_sys::general::FSPICK_NO_AUTOMOUNT;
+
+ /// `FSPICK_EMPTY_PATH`
+ const FSPICK_EMPTY_PATH = linux_raw_sys::general::FSPICK_EMPTY_PATH;
+ }
+}
+
+bitflags! {
+ /// `MS_*` constants for use with [`change_mount`].
+ ///
+ /// [`change_mount`]: crate::mount::change_mount
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub struct MountPropagationFlags: c::c_uint {
+ /// `MS_SILENT`
+ const SILENT = linux_raw_sys::general::MS_SILENT;
+ /// `MS_SHARED`
+ const SHARED = linux_raw_sys::general::MS_SHARED;
+ /// `MS_PRIVATE`
+ const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
+ /// `MS_SLAVE`
+ const SLAVE = linux_raw_sys::general::MS_SLAVE;
+ /// `MS_UNBINDABLE`
+ const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
+ /// `MS_REC`
+ const REC = linux_raw_sys::general::MS_REC;
+ }
+}
+
+bitflags! {
+ #[repr(transparent)]
+ #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+ pub(crate) struct InternalMountFlags: c::c_uint {
+ const REMOUNT = linux_raw_sys::general::MS_REMOUNT;
+ const MOVE = linux_raw_sys::general::MS_MOVE;
+ }
+}
+
+#[repr(transparent)]
+pub(crate) struct MountFlagsArg(pub(crate) c::c_uint);
diff --git a/vendor/rustix/src/backend/linux_raw/net/syscalls.rs b/vendor/rustix/src/backend/linux_raw/net/syscalls.rs
index dca331783..df35e63c8 100644
--- a/vendor/rustix/src/backend/linux_raw/net/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/net/syscalls.rs
@@ -430,6 +430,7 @@ pub(crate) fn send(fd: BorrowedFd<'_>, buf: &[u8], flags: SendFlags) -> io::Resu
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86",
target_arch = "x86_64",
@@ -440,6 +441,7 @@ pub(crate) fn send(fd: BorrowedFd<'_>, buf: &[u8], flags: SendFlags) -> io::Resu
#[cfg(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86_64",
))]
@@ -585,6 +587,7 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io::
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86",
target_arch = "x86_64",
@@ -595,6 +598,7 @@ pub(crate) fn recv(fd: BorrowedFd<'_>, buf: &mut [u8], flags: RecvFlags) -> io::
#[cfg(any(
target_arch = "aarch64",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
target_arch = "x86_64",
))]
diff --git a/vendor/rustix/src/backend/linux_raw/param/auxv.rs b/vendor/rustix/src/backend/linux_raw/param/auxv.rs
index bf8935a0d..144ff10cd 100644
--- a/vendor/rustix/src/backend/linux_raw/param/auxv.rs
+++ b/vendor/rustix/src/backend/linux_raw/param/auxv.rs
@@ -161,6 +161,7 @@ fn pr_get_auxv() -> crate::io::Result<Vec<u8>> {
/// On non-Mustang platforms, we read the aux vector via the `prctl`
/// `PR_GET_AUXV`, with a fallback to /proc/self/auxv for kernels that don't
/// support `PR_GET_AUXV`.
+#[cold]
fn init_auxv() {
match pr_get_auxv() {
Ok(buffer) => {
@@ -185,6 +186,7 @@ fn init_auxv() {
}
/// Process auxv entries from the open file `auxv`.
+#[cold]
fn init_from_auxv_file(auxv: OwnedFd) -> Option<()> {
let mut buffer = Vec::<u8>::with_capacity(512);
loop {
@@ -220,6 +222,7 @@ fn init_from_auxv_file(auxv: OwnedFd) -> Option<()> {
///
/// The buffer contains `Elf_aux_t` elements, though it need not be aligned;
/// function uses `read_unaligned` to read from it.
+#[cold]
unsafe fn init_from_auxp(mut auxp: *const Elf_auxv_t) -> Option<()> {
let mut pagesz = 0;
let mut clktck = 0;
@@ -272,6 +275,7 @@ unsafe fn init_from_auxp(mut auxp: *const Elf_auxv_t) -> Option<()> {
/// `base` is some value we got from a `AT_BASE` aux record somewhere,
/// which hopefully holds the value of the program interpreter in memory. Do a
/// series of checks to be as sure as we can that it's safe to use.
+#[cold]
unsafe fn check_interpreter_base(base: *const Elf_Ehdr) -> Option<()> {
check_elf_base(base)?;
Some(())
@@ -282,6 +286,7 @@ unsafe fn check_interpreter_base(base: *const Elf_Ehdr) -> Option<()> {
/// `base` is some value we got from a `AT_SYSINFO_EHDR` aux record somewhere,
/// which hopefully holds the value of the kernel-provided vDSO in memory. Do a
/// series of checks to be as sure as we can that it's safe to use.
+#[cold]
unsafe fn check_vdso_base(base: *const Elf_Ehdr) -> Option<NonNull<Elf_Ehdr>> {
// In theory, we could check that we're not attempting to parse our own ELF
// image, as an additional check. However, older Linux toolchains don't
@@ -331,6 +336,7 @@ unsafe fn check_vdso_base(base: *const Elf_Ehdr) -> Option<NonNull<Elf_Ehdr>> {
}
/// Check that `base` is a valid pointer to an ELF image.
+#[cold]
unsafe fn check_elf_base(base: *const Elf_Ehdr) -> Option<NonNull<Elf_Ehdr>> {
// If we're reading a 64-bit auxv on a 32-bit platform, we'll see
// a zero `a_val` because `AT_*` values are never greater than
diff --git a/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs b/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs
index d05a87e53..97739fcb5 100644
--- a/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs
+++ b/vendor/rustix/src/backend/linux_raw/param/libc_auxv.rs
@@ -41,27 +41,23 @@ extern "C" {
#[cfg(target_os = "android")]
const _SC_PAGESIZE: c::c_int = 39;
-#[cfg(target_os = "emscripten")]
-const _SC_PAGESIZE: c::c_int = 30;
#[cfg(target_os = "linux")]
const _SC_PAGESIZE: c::c_int = 30;
#[cfg(target_os = "android")]
const _SC_CLK_TCK: c::c_int = 6;
-#[cfg(target_os = "emscripten")]
-const _SC_CLK_TCK: c::c_int = 2;
#[cfg(target_os = "linux")]
const _SC_CLK_TCK: c::c_int = 2;
#[test]
fn test_abi() {
- assert_eq!(self::_SC_PAGESIZE, ::libc::_SC_PAGESIZE);
- assert_eq!(self::_SC_CLK_TCK, ::libc::_SC_CLK_TCK);
- assert_eq!(self::AT_PHDR, ::libc::AT_PHDR);
- assert_eq!(self::AT_PHNUM, ::libc::AT_PHNUM);
- assert_eq!(self::AT_HWCAP, ::libc::AT_HWCAP);
- assert_eq!(self::AT_HWCAP2, ::libc::AT_HWCAP2);
- assert_eq!(self::AT_EXECFN, ::libc::AT_EXECFN);
- assert_eq!(self::AT_SYSINFO_EHDR, ::libc::AT_SYSINFO_EHDR);
+ const_assert_eq!(self::_SC_PAGESIZE, ::libc::_SC_PAGESIZE);
+ const_assert_eq!(self::_SC_CLK_TCK, ::libc::_SC_CLK_TCK);
+ const_assert_eq!(self::AT_PHDR, ::libc::AT_PHDR);
+ const_assert_eq!(self::AT_PHNUM, ::libc::AT_PHNUM);
+ const_assert_eq!(self::AT_HWCAP, ::libc::AT_HWCAP);
+ const_assert_eq!(self::AT_HWCAP2, ::libc::AT_HWCAP2);
+ const_assert_eq!(self::AT_EXECFN, ::libc::AT_EXECFN);
+ const_assert_eq!(self::AT_SYSINFO_EHDR, ::libc::AT_SYSINFO_EHDR);
}
#[cfg(feature = "param")]
diff --git a/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs b/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs
index ed121089d..e05094237 100644
--- a/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/pipe/syscalls.rs
@@ -23,7 +23,9 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> {
#[cfg(any(
target_arch = "aarch64",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
))]
{
@@ -32,7 +34,9 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> {
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "riscv64",
)))]
unsafe {
diff --git a/vendor/rustix/src/backend/linux_raw/process/syscalls.rs b/vendor/rustix/src/backend/linux_raw/process/syscalls.rs
index ac6e28901..5ec2755ff 100644
--- a/vendor/rustix/src/backend/linux_raw/process/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/process/syscalls.rs
@@ -33,7 +33,6 @@ use linux_raw_sys::general::{
RLIM64_INFINITY, RLIM_INFINITY,
};
use linux_raw_sys::ioctl::TIOCSCTTY;
-#[cfg(not(target_os = "wasi"))]
#[cfg(feature = "fs")]
use {crate::backend::conv::ret_c_uint_infallible, crate::fs::Mode};
diff --git a/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs b/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs
index c2d1b07c1..529564c34 100644
--- a/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/pty/syscalls.rs
@@ -13,12 +13,10 @@ use crate::ffi::CString;
use crate::io;
use crate::path::DecInt;
use crate::pty::OpenptFlags;
-#[cfg(any(apple, freebsdlike, linux_like, target_os = "fuchsia"))]
use alloc::vec::Vec;
use core::mem::MaybeUninit;
use linux_raw_sys::ioctl::{TIOCGPTN, TIOCGPTPEER, TIOCSPTLCK};
-#[cfg(any(apple, freebsdlike, linux_like, target_os = "fuchsia"))]
#[inline]
pub(crate) fn ptsname(fd: BorrowedFd, mut buffer: Vec<u8>) -> io::Result<CString> {
unsafe {
diff --git a/vendor/rustix/src/backend/linux_raw/reg.rs b/vendor/rustix/src/backend/linux_raw/reg.rs
index 206031dde..c4e495c52 100644
--- a/vendor/rustix/src/backend/linux_raw/reg.rs
+++ b/vendor/rustix/src/backend/linux_raw/reg.rs
@@ -1,9 +1,8 @@
//! Encapsulation for system call arguments and return values.
//!
-//! The inline-asm and outline-asm code paths do some amount of reordering
-//! of arguments; to ensure that we don't accidentally misroute an argument
-//! or return value, we use distinct types for each argument index and
-//! return value.
+//! The inline-asm code paths do some amount of reordering of arguments; to
+//! ensure that we don't accidentally misroute an argument or return value,
+//! we use distinct types for each argument index and return value.
//!
//! # Safety
//!
@@ -55,7 +54,7 @@ pub(super) struct A2(());
pub(super) struct A3(());
pub(super) struct A4(());
pub(super) struct A5(());
-#[cfg(target_arch = "mips")]
+#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
pub(super) struct A6(());
#[cfg(target_arch = "x86")]
pub(super) struct SocketArg;
@@ -67,7 +66,7 @@ impl ArgNumber for A2 {}
impl ArgNumber for A3 {}
impl ArgNumber for A4 {}
impl ArgNumber for A5 {}
-#[cfg(target_arch = "mips")]
+#[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
impl ArgNumber for A6 {}
#[cfg(target_arch = "x86")]
impl ArgNumber for SocketArg {}
@@ -251,7 +250,7 @@ mod private {
impl Sealed for super::A3 {}
impl Sealed for super::A4 {}
impl Sealed for super::A5 {}
- #[cfg(target_arch = "mips")]
+ #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
impl Sealed for super::A6 {}
#[cfg(target_arch = "x86")]
impl Sealed for super::SocketArg {}
diff --git a/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs b/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs
index b9814e731..f82e2187b 100644
--- a/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/runtime/syscalls.rs
@@ -22,7 +22,7 @@ use crate::pid::Pid;
use crate::runtime::{How, Sigaction, Siginfo, Sigset, Stack};
use crate::signal::Signal;
use crate::timespec::Timespec;
-use crate::utils::optional_as_ptr;
+use crate::utils::option_as_ptr;
use core::mem::MaybeUninit;
#[cfg(target_pointer_width = "32")]
use linux_raw_sys::general::__kernel_old_timespec;
@@ -117,7 +117,7 @@ pub(crate) mod tls {
#[inline]
pub(crate) unsafe fn sigaction(signal: Signal, new: Option<Sigaction>) -> io::Result<Sigaction> {
let mut old = MaybeUninit::<Sigaction>::uninit();
- let new = optional_as_ptr(new.as_ref());
+ let new = option_as_ptr(new.as_ref());
ret(syscall!(
__NR_rt_sigaction,
signal,
@@ -131,7 +131,7 @@ pub(crate) unsafe fn sigaction(signal: Signal, new: Option<Sigaction>) -> io::Re
#[inline]
pub(crate) unsafe fn sigaltstack(new: Option<Stack>) -> io::Result<Stack> {
let mut old = MaybeUninit::<Stack>::uninit();
- let new = optional_as_ptr(new.as_ref());
+ let new = option_as_ptr(new.as_ref());
ret(syscall!(__NR_sigaltstack, new, &mut old))?;
Ok(old.assume_init())
}
@@ -144,7 +144,7 @@ pub(crate) unsafe fn tkill(tid: Pid, sig: Signal) -> io::Result<()> {
#[inline]
pub(crate) unsafe fn sigprocmask(how: How, new: Option<&Sigset>) -> io::Result<Sigset> {
let mut old = MaybeUninit::<Sigset>::uninit();
- let new = optional_as_ptr(new);
+ let new = option_as_ptr(new);
ret(syscall!(
__NR_rt_sigprocmask,
how,
@@ -189,7 +189,7 @@ pub(crate) fn sigwaitinfo(set: &Sigset) -> io::Result<Siginfo> {
#[inline]
pub(crate) fn sigtimedwait(set: &Sigset, timeout: Option<Timespec>) -> io::Result<Siginfo> {
let mut info = MaybeUninit::<Siginfo>::uninit();
- let timeout_ptr = optional_as_ptr(timeout.as_ref());
+ let timeout_ptr = option_as_ptr(timeout.as_ref());
// `rt_sigtimedwait_time64` was introduced in Linux 5.1. The old
// `rt_sigtimedwait` syscall is not y2038-compatible on 32-bit
@@ -237,7 +237,7 @@ unsafe fn sigtimedwait_old(
None => None,
};
- let old_timeout_ptr = optional_as_ptr(old_timeout.as_ref());
+ let old_timeout_ptr = option_as_ptr(old_timeout.as_ref());
let _signum = ret_c_int(syscall!(
__NR_rt_sigtimedwait,
diff --git a/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs b/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs
index 5e21397bc..8f030e1c3 100644
--- a/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/termios/syscalls.rs
@@ -63,7 +63,12 @@ pub(crate) fn tcsetattr(
// Translate from `optional_actions` into an ioctl request code. On MIPS,
// `optional_actions` already has `TCGETS` added to it.
let request = linux_raw_sys::ioctl::TCSETS2
- + if cfg!(any(target_arch = "mips", target_arch = "mips64")) {
+ + if cfg!(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )) {
optional_actions as u32 - linux_raw_sys::ioctl::TCSETS
} else {
optional_actions as u32
diff --git a/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs b/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
index 422793690..316d26a1c 100644
--- a/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
+++ b/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
@@ -12,8 +12,8 @@
#[cfg(target_arch = "x86")]
use super::reg::{ArgReg, RetReg, SyscallNumber, A0, A1, A2, A3, A4, A5, R0};
use super::vdso;
-#[cfg(all(asm, target_arch = "x86"))]
-use core::arch::asm;
+#[cfg(target_arch = "x86")]
+use core::arch::global_asm;
use core::mem::transmute;
use core::ptr::null_mut;
use core::sync::atomic::AtomicPtr;
@@ -45,6 +45,10 @@ pub(crate) fn clock_gettime(which_clock: ClockId) -> __kernel_timespec {
None => init_clock_gettime(),
};
let r0 = callee(which_clock as c::c_int, result.as_mut_ptr());
+ // The `ClockId` enum only contains clocks which never fail. It may be
+ // tempting to change this to `debug_assert_eq`, however they can still
+ // fail on uncommon kernel configs, so we leave this in place to ensure
+ // that we don't execute undefined behavior if they ever do fail.
assert_eq!(r0, 0);
result.assume_init()
}
@@ -227,6 +231,7 @@ pub(super) type SyscallType = unsafe extern "C" fn();
/// Initialize `CLOCK_GETTIME` and return its value.
#[cfg(feature = "time")]
+#[cold]
fn init_clock_gettime() -> ClockGettimeType {
init();
// SAFETY: Load the function address from static storage that we
@@ -236,6 +241,7 @@ fn init_clock_gettime() -> ClockGettimeType {
/// Initialize `SYSCALL` and return its value.
#[cfg(target_arch = "x86")]
+#[cold]
fn init_syscall() -> SyscallType {
init();
// SAFETY: Load the function address from static storage that we
@@ -310,21 +316,34 @@ unsafe fn _rustix_clock_gettime_via_syscall(
ret(syscall!(__NR_clock_gettime, c_int(clockid), res))
}
-/// A symbol pointing to an `int 0x80` instruction. This “function” is only
-/// called from assembly, and only with the x86 syscall calling convention,
-/// so its signature here is not its true signature.
-#[cfg(all(asm, target_arch = "x86"))]
-#[naked]
-unsafe extern "C" fn rustix_int_0x80() {
- asm!("int $$0x80", "ret", options(noreturn))
-}
-
-// The outline version of the `rustix_int_0x80` above.
-#[cfg(all(not(asm), target_arch = "x86"))]
+#[cfg(target_arch = "x86")]
extern "C" {
+ /// A symbol pointing to an `int 0x80` instruction. This “function” is only
+ /// called from assembly, and only with the x86 syscall calling convention.
+ /// so its signature here is not its true signature.
+ ///
+ /// This extern block and the `global_asm!` below can be replaced with
+ /// `#[naked]` if it's stabilized.
fn rustix_int_0x80();
}
+#[cfg(target_arch = "x86")]
+global_asm!(
+ r#"
+ .section .text.rustix_int_0x80,"ax",@progbits
+ .p2align 4
+ .weak rustix_int_0x80
+ .hidden rustix_int_0x80
+ .type rustix_int_0x80, @function
+rustix_int_0x80:
+ .cfi_startproc
+ int 0x80
+ ret
+ .cfi_endproc
+ .size rustix_int_0x80, .-rustix_int_0x80
+"#
+);
+
fn minimal_init() {
// SAFETY: Store default function addresses in static storage so that if we
// end up making any system calls while we read the vDSO, they'll work.
@@ -380,9 +399,9 @@ fn init() {
let ptr = vdso.sym(cstr!("LINUX_4.15"), cstr!("__vdso_clock_gettime"));
#[cfg(target_arch = "powerpc64")]
let ptr = vdso.sym(cstr!("LINUX_2.6.15"), cstr!("__kernel_clock_gettime"));
- #[cfg(target_arch = "mips")]
+ #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))]
let ptr = vdso.sym(cstr!("LINUX_2.6"), cstr!("__vdso_clock_gettime64"));
- #[cfg(target_arch = "mips64")]
+ #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))]
let ptr = vdso.sym(cstr!("LINUX_2.6"), cstr!("__vdso_clock_gettime"));
// On all 64-bit platforms, the 64-bit `clock_gettime` symbols are
@@ -392,7 +411,12 @@ fn init() {
// On some 32-bit platforms, the 64-bit `clock_gettime` symbols are not
// available on older kernel versions.
- #[cfg(any(target_arch = "arm", target_arch = "mips", target_arch = "x86"))]
+ #[cfg(any(
+ target_arch = "arm",
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "x86"
+ ))]
let ok = !ptr.is_null();
if ok {
diff --git a/vendor/rustix/src/check_types.rs b/vendor/rustix/src/check_types.rs
index 2ba1f3f9e..861d7d7b5 100644
--- a/vendor/rustix/src/check_types.rs
+++ b/vendor/rustix/src/check_types.rs
@@ -3,16 +3,8 @@
/// Check that the size and alignment of a type match the `sys` bindings.
macro_rules! check_type {
($struct:ident) => {
- assert_eq!(
- (
- core::mem::size_of::<$struct>(),
- core::mem::align_of::<$struct>()
- ),
- (
- core::mem::size_of::<c::$struct>(),
- core::mem::align_of::<c::$struct>()
- )
- );
+ assert_eq_size!($struct, c::$struct);
+ assert_eq_align!($struct, c::$struct);
};
}
@@ -20,13 +12,8 @@ macro_rules! check_type {
/// renamed to avoid having types like `bindgen_ty_1` in the API.
macro_rules! check_renamed_type {
($to:ident, $from:ident) => {
- assert_eq!(
- (core::mem::size_of::<$to>(), core::mem::align_of::<$to>()),
- (
- core::mem::size_of::<c::$from>(),
- core::mem::align_of::<c::$from>()
- )
- );
+ assert_eq_size!($to, c::$from);
+ assert_eq_align!($to, c::$from);
};
}
@@ -34,15 +21,16 @@ macro_rules! check_renamed_type {
/// corresponding field in the `sys` bindings.
macro_rules! check_struct_field {
($struct:ident, $field:ident) => {
+ const_assert_eq!(
+ memoffset::offset_of!($struct, $field),
+ memoffset::offset_of!(c::$struct, $field)
+ );
+
+ // This can't use `const_assert_eq` because `span_of` returns a
+ // `Range`, which can't be compared in const contexts.
assert_eq!(
- (
- memoffset::offset_of!($struct, $field),
- memoffset::span_of!($struct, $field)
- ),
- (
- memoffset::offset_of!(c::$struct, $field),
- memoffset::span_of!(c::$struct, $field)
- )
+ memoffset::span_of!($struct, $field),
+ memoffset::span_of!(c::$struct, $field)
);
};
}
@@ -51,15 +39,15 @@ macro_rules! check_struct_field {
/// we've renamed to avoid having types like `bindgen_ty_1` in the API.
macro_rules! check_struct_renamed_field {
($struct:ident, $to:ident, $from:ident) => {
+ const_assert_eq!(
+ memoffset::offset_of!($struct, $to),
+ memoffset::offset_of!(c::$struct, $from)
+ );
+
+ // As above, this can't use `const_assert_eq`.
assert_eq!(
- (
- memoffset::offset_of!($struct, $to),
- memoffset::span_of!($struct, $to)
- ),
- (
- memoffset::offset_of!(c::$struct, $from),
- memoffset::span_of!(c::$struct, $from)
- )
+ memoffset::span_of!($struct, $to),
+ memoffset::span_of!(c::$struct, $from)
);
};
}
@@ -68,15 +56,15 @@ macro_rules! check_struct_renamed_field {
/// and a field are renamed.
macro_rules! check_renamed_struct_renamed_field {
($to_struct:ident, $from_struct:ident, $to:ident, $from:ident) => {
+ const_assert_eq!(
+ memoffset::offset_of!($to_struct, $to),
+ memoffset::offset_of!(c::$from_struct, $from)
+ );
+
+ // As above, this can't use `const_assert_eq`.
assert_eq!(
- (
- memoffset::offset_of!($to_struct, $to),
- memoffset::span_of!($to_struct, $to)
- ),
- (
- memoffset::offset_of!(c::$from_struct, $from),
- memoffset::span_of!(c::$from_struct, $from)
- )
+ memoffset::span_of!($to_struct, $to),
+ memoffset::span_of!(c::$from_struct, $from)
);
};
}
diff --git a/vendor/rustix/src/clockid.rs b/vendor/rustix/src/clockid.rs
index 84ae650a5..abeeb7095 100644
--- a/vendor/rustix/src/clockid.rs
+++ b/vendor/rustix/src/clockid.rs
@@ -52,6 +52,8 @@ pub enum ClockId {
/// has to fail with `INVAL` due to an unsupported clock. See
/// [`DynamicClockId`] for a greater set of clocks, with the caveat that not
/// all of them are always supported.
+///
+/// [`clock_gettime`]: crate::time::clock_gettime
#[cfg(apple)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
#[repr(u32)]
@@ -96,10 +98,15 @@ pub enum DynamicClockId<'a> {
Tai,
/// `CLOCK_BOOTTIME`, available on Linux >= 2.6.39
- #[cfg(any(linux_kernel, target_os = "openbsd"))]
+ #[cfg(any(
+ freebsdlike,
+ linux_kernel,
+ target_os = "fuchsia",
+ target_os = "openbsd"
+ ))]
Boottime,
/// `CLOCK_BOOTTIME_ALARM`, available on Linux >= 2.6.39
- #[cfg(linux_kernel)]
+ #[cfg(any(linux_kernel, target_os = "fuchsia"))]
BoottimeAlarm,
}
diff --git a/vendor/rustix/src/cstr.rs b/vendor/rustix/src/cstr.rs
index 0df1bf7cd..d32436e18 100644
--- a/vendor/rustix/src/cstr.rs
+++ b/vendor/rustix/src/cstr.rs
@@ -9,13 +9,13 @@
///
/// # Examples
///
-/// ```no_run
+/// ```
/// # #[cfg(feature = "fs")]
/// # fn main() -> rustix::io::Result<()> {
/// use rustix::cstr;
/// use rustix::fs::{statat, AtFlags, CWD};
///
-/// let metadata = statat(CWD, cstr!("test.txt"), AtFlags::empty())?;
+/// let metadata = statat(CWD, cstr!("Cargo.toml"), AtFlags::empty())?;
/// # Ok(())
/// # }
/// # #[cfg(not(feature = "fs"))]
diff --git a/vendor/rustix/src/fs/abs.rs b/vendor/rustix/src/fs/abs.rs
index 83531a4e7..81e991772 100644
--- a/vendor/rustix/src/fs/abs.rs
+++ b/vendor/rustix/src/fs/abs.rs
@@ -2,17 +2,21 @@
use crate::fd::OwnedFd;
use crate::ffi::{CStr, CString};
+#[cfg(not(target_os = "espidf"))]
+use crate::fs::Access;
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
use crate::fs::StatFs;
#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
use crate::fs::StatVfs;
-use crate::fs::{Access, Mode, OFlags, Stat};
+use crate::fs::{Mode, OFlags, Stat};
use crate::path::SMALL_PATH_BUFFER_SIZE;
use crate::{backend, io, path};
use alloc::vec::Vec;
@@ -215,6 +219,7 @@ pub fn mkdir<P: path::Arg>(path: P, mode: Mode) -> io::Result<()> {
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html
/// [Linux]: https://man7.org/linux/man-pages/man2/access.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn access<P: path::Arg>(path: P, access: Access) -> io::Result<()> {
path.into_with_c_str(|path| backend::fs::syscalls::access(path, access))
@@ -231,8 +236,10 @@ pub fn access<P: path::Arg>(path: P, access: Access) -> io::Result<()> {
/// [Linux]: https://man7.org/linux/man-pages/man2/statfs.2.html
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
diff --git a/vendor/rustix/src/fs/at.rs b/vendor/rustix/src/fs/at.rs
index 0c99cc30a..5bd90fab5 100644
--- a/vendor/rustix/src/fs/at.rs
+++ b/vendor/rustix/src/fs/at.rs
@@ -9,31 +9,35 @@ use crate::fd::OwnedFd;
use crate::ffi::{CStr, CString};
#[cfg(apple)]
use crate::fs::CloneFlags;
-#[cfg(not(any(apple, target_os = "wasi")))]
+#[cfg(not(any(apple, target_os = "espidf", target_os = "wasi")))]
use crate::fs::FileType;
#[cfg(linux_kernel)]
use crate::fs::RenameFlags;
-use crate::fs::{Access, AtFlags, Mode, OFlags, Stat, Timestamps};
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
use crate::fs::{Gid, Uid};
+use crate::fs::{Mode, OFlags};
use crate::path::SMALL_PATH_BUFFER_SIZE;
-use crate::timespec::Nsecs;
use crate::{backend, io, path};
use alloc::vec::Vec;
use backend::fd::{AsFd, BorrowedFd};
+#[cfg(not(target_os = "espidf"))]
+use {
+ crate::fs::{Access, AtFlags, Stat, Timestamps},
+ crate::timespec::Nsecs,
+};
pub use backend::fs::types::{Dev, RawMode};
/// `UTIME_NOW` for use with [`utimensat`].
///
/// [`utimensat`]: crate::fs::utimensat
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub const UTIME_NOW: Nsecs = backend::c::UTIME_NOW as Nsecs;
/// `UTIME_OMIT` for use with [`utimensat`].
///
/// [`utimensat`]: crate::fs::utimensat
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub const UTIME_OMIT: Nsecs = backend::c::UTIME_OMIT as Nsecs;
/// `openat(dirfd, path, oflags, mode)`—Opens a file.
@@ -144,6 +148,7 @@ pub fn mkdirat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, mode: Mode) -> io::Re
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/linkat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
old_dirfd: PFd,
@@ -177,6 +182,7 @@ pub fn linkat<P: path::Arg, Q: path::Arg, PFd: AsFd, QFd: AsFd>(
/// [`REMOVEDIR`]: AtFlags::REMOVEDIR
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/unlinkat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn unlinkat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<()> {
path.into_with_c_str(|path| backend::fs::syscalls::unlinkat(dirfd.as_fd(), path, flags))
@@ -274,6 +280,7 @@ pub fn symlinkat<P: path::Arg, Q: path::Arg, Fd: AsFd>(
/// [Linux]: https://man7.org/linux/man-pages/man2/fstatat.2.html
/// [`Mode::from_raw_mode`]: crate::fs::Mode::from_raw_mode
/// [`FileType::from_raw_mode`]: crate::fs::FileType::from_raw_mode
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "fstatat")]
pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io::Result<Stat> {
@@ -296,6 +303,7 @@ pub fn statat<P: path::Arg, Fd: AsFd>(dirfd: Fd, path: P, flags: AtFlags) -> io:
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/faccessat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "faccessat")]
pub fn accessat<P: path::Arg, Fd: AsFd>(
@@ -315,6 +323,7 @@ pub fn accessat<P: path::Arg, Fd: AsFd>(
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/utimensat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn utimensat<P: path::Arg, Fd: AsFd>(
dirfd: Fd,
@@ -337,7 +346,7 @@ pub fn utimensat<P: path::Arg, Fd: AsFd>(
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/fchmodat.2.html
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "fchmodat")]
pub fn chmodat<P: path::Arg, Fd: AsFd>(
@@ -376,7 +385,7 @@ pub fn fclonefileat<Fd: AsFd, DstFd: AsFd, P: path::Arg>(
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknodat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/mknodat.2.html
-#[cfg(not(any(apple, target_os = "wasi")))]
+#[cfg(not(any(apple, target_os = "espidf", target_os = "wasi")))]
#[inline]
pub fn mknodat<P: path::Arg, Fd: AsFd>(
dirfd: Fd,
@@ -399,7 +408,7 @@ pub fn mknodat<P: path::Arg, Fd: AsFd>(
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html
/// [Linux]: https://man7.org/linux/man-pages/man2/fchownat.2.html
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "fchownat")]
pub fn chownat<P: path::Arg, Fd: AsFd>(
diff --git a/vendor/rustix/src/fs/constants.rs b/vendor/rustix/src/fs/constants.rs
index ef677aa49..85889d90e 100644
--- a/vendor/rustix/src/fs/constants.rs
+++ b/vendor/rustix/src/fs/constants.rs
@@ -3,9 +3,11 @@
use crate::backend;
pub use crate::io::FdFlags;
-pub use backend::fs::types::{Access, Dev, Mode, OFlags};
+#[cfg(not(target_os = "espidf"))]
+pub use backend::fs::types::Access;
+pub use backend::fs::types::{Dev, Mode, OFlags};
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub use backend::fs::types::AtFlags;
#[cfg(apple)]
diff --git a/vendor/rustix/src/fs/cwd.rs b/vendor/rustix/src/fs/cwd.rs
index 2745060a1..e66360e43 100644
--- a/vendor/rustix/src/fs/cwd.rs
+++ b/vendor/rustix/src/fs/cwd.rs
@@ -25,13 +25,11 @@ use backend::fd::{BorrowedFd, RawFd};
// SAFETY: `AT_FDCWD` is a reserved value that is never dynamically
// allocated, so it'll remain valid for the duration of `'static`.
#[doc(alias = "AT_FDCWD")]
-#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
pub const CWD: BorrowedFd<'static> =
unsafe { BorrowedFd::<'static>::borrow_raw(c::AT_FDCWD as RawFd) };
/// Return the value of [`CWD`].
#[deprecated(note = "Use `CWD` in place of `cwd()`.")]
-#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
pub const fn cwd() -> BorrowedFd<'static> {
let at_fdcwd = c::AT_FDCWD as RawFd;
diff --git a/vendor/rustix/src/fs/fcntl.rs b/vendor/rustix/src/fs/fcntl.rs
index 91816aaa2..f7f4790cb 100644
--- a/vendor/rustix/src/fs/fcntl.rs
+++ b/vendor/rustix/src/fs/fcntl.rs
@@ -5,6 +5,7 @@
#[cfg(not(any(
target_os = "emscripten",
+ target_os = "espidf",
target_os = "fuchsia",
target_os = "redox",
target_os = "wasi"
@@ -17,7 +18,7 @@ use backend::fs::types::OFlags;
// These `fcntl` functions like in the `io` module because they're not specific
// to files, directories, or memfd objects. We re-export them here in the `fs`
// module because the other the `fcntl` functions are here.
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use crate::io::fcntl_dupfd_cloexec;
pub use crate::io::{fcntl_getfd, fcntl_setfd};
@@ -96,6 +97,7 @@ pub fn fcntl_add_seals<Fd: AsFd>(fd: Fd, seals: SealFlags) -> io::Result<()> {
/// [Linux]: https://man7.org/linux/man-pages/man2/fcntl.2.html
#[cfg(not(any(
target_os = "emscripten",
+ target_os = "espidf",
target_os = "fuchsia",
target_os = "redox",
target_os = "wasi"
diff --git a/vendor/rustix/src/fs/fcntl_apple.rs b/vendor/rustix/src/fs/fcntl_apple.rs
index 6d624ee47..a32e46d74 100644
--- a/vendor/rustix/src/fs/fcntl_apple.rs
+++ b/vendor/rustix/src/fs/fcntl_apple.rs
@@ -7,6 +7,7 @@ use backend::fd::AsFd;
/// - [Apple]
///
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_RDADVISE")]
#[inline]
pub fn fcntl_rdadvise<Fd: AsFd>(fd: Fd, offset: u64, len: u64) -> io::Result<()> {
backend::fs::syscalls::fcntl_rdadvise(fd.as_fd(), offset, len)
@@ -18,7 +19,48 @@ pub fn fcntl_rdadvise<Fd: AsFd>(fd: Fd, offset: u64, len: u64) -> io::Result<()>
/// - [Apple]
///
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_FULLSYNC")]
#[inline]
pub fn fcntl_fullfsync<Fd: AsFd>(fd: Fd) -> io::Result<()> {
backend::fs::syscalls::fcntl_fullfsync(fd.as_fd())
}
+
+/// `fcntl(fd, F_NOCACHE, value)`—Turn data caching off or on for a file
+/// descriptor.
+///
+/// See [this mailing list post] for additional information about the meanings
+/// of `F_NOCACHE` and `F_GLOBAL_NOCACHE`.
+///
+/// [this mailing list post]: https://lists.apple.com/archives/filesystem-dev/2007/Sep/msg00010.html
+///
+/// See also [`fcntl_global_nocache`].
+///
+/// # References
+/// - [Apple]
+///
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_NOCACHE")]
+#[inline]
+pub fn fcntl_nocache<Fd: AsFd>(fd: Fd, value: bool) -> io::Result<()> {
+ backend::fs::syscalls::fcntl_nocache(fd.as_fd(), value)
+}
+
+/// `fcntl(fd, F_GLOBAL_NOCACHE, value)`—Turn data caching off or on for all
+/// file descriptors.
+///
+/// See [this mailing list post] for additional information about the meanings
+/// of `F_NOCACHE` and `F_GLOBAL_NOCACHE`.
+///
+/// [this mailing list post]: https://lists.apple.com/archives/filesystem-dev/2007/Sep/msg00010.html
+///
+/// See also [`fcntl_nocache`].
+///
+/// # References
+/// - [Apple]
+///
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
+#[doc(alias = "F_GLOBAL_NOCACHE")]
+#[inline]
+pub fn fcntl_global_nocache<Fd: AsFd>(fd: Fd, value: bool) -> io::Result<()> {
+ backend::fs::syscalls::fcntl_global_nocache(fd.as_fd(), value)
+}
diff --git a/vendor/rustix/src/fs/fd.rs b/vendor/rustix/src/fs/fd.rs
index d0d50073e..43b2e57b1 100644
--- a/vendor/rustix/src/fs/fd.rs
+++ b/vendor/rustix/src/fs/fd.rs
@@ -8,7 +8,7 @@ use crate::fs::{OFlags, SeekFrom, Timespec};
use crate::{backend, io};
use backend::fd::{AsFd, BorrowedFd};
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use backend::fs::types::FlockOperation;
#[cfg(not(any(
@@ -16,6 +16,8 @@ pub use backend::fs::types::FlockOperation;
solarish,
target_os = "aix",
target_os = "dragonfly",
+ target_os = "espidf",
+ target_os = "nto",
target_os = "redox",
)))]
pub use backend::fs::types::FallocateFlags;
@@ -24,8 +26,10 @@ pub use backend::fs::types::Stat;
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -161,8 +165,10 @@ pub fn fstat<Fd: AsFd>(fd: Fd) -> io::Result<Stat> {
/// [Linux]: https://man7.org/linux/man-pages/man2/fstatfs.2.html
#[cfg(not(any(
solarish,
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
target_os = "redox",
target_os = "wasi",
)))]
@@ -199,6 +205,7 @@ pub fn fstatvfs<Fd: AsFd>(fd: Fd) -> io::Result<StatVfs> {
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html
/// [Linux]: https://man7.org/linux/man-pages/man2/utimensat.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> {
backend::fs::syscalls::futimens(fd.as_fd(), times)
@@ -224,6 +231,8 @@ pub fn futimens<Fd: AsFd>(fd: Fd, times: &Timestamps) -> io::Result<()> {
solarish,
target_os = "aix",
target_os = "dragonfly",
+ target_os = "espidf",
+ target_os = "nto",
target_os = "redox",
)))] // not implemented in libc for netbsd yet
#[inline]
@@ -292,6 +301,7 @@ pub fn fsync<Fd: AsFd>(fd: Fd) -> io::Result<()> {
#[cfg(not(any(
apple,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -319,7 +329,7 @@ pub fn ftruncate<Fd: AsFd>(fd: Fd, length: u64) -> io::Result<()> {
/// - [Linux]
///
/// [Linux]: https://man7.org/linux/man-pages/man2/flock.2.html
-#[cfg(not(any(target_os = "solaris", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "solaris", target_os = "wasi")))]
#[inline]
pub fn flock<Fd: AsFd>(fd: Fd, operation: FlockOperation) -> io::Result<()> {
backend::fs::syscalls::flock(fd.as_fd(), operation)
diff --git a/vendor/rustix/src/fs/mod.rs b/vendor/rustix/src/fs/mod.rs
index fc2c3368b..fbfaa12c9 100644
--- a/vendor/rustix/src/fs/mod.rs
+++ b/vendor/rustix/src/fs/mod.rs
@@ -6,15 +6,17 @@ mod at;
mod constants;
#[cfg(linux_kernel)]
mod copy_file_range;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
+#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
mod cwd;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
mod dir;
#[cfg(not(any(
apple,
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
@@ -32,11 +34,17 @@ mod getpath;
mod id;
#[cfg(not(target_os = "wasi"))]
mod ioctl;
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
mod makedev;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
mod memfd_create;
#[cfg(linux_kernel)]
+#[cfg(feature = "fs")]
mod mount;
#[cfg(linux_kernel)]
mod openat2;
@@ -47,7 +55,7 @@ mod seek_from;
mod sendfile;
#[cfg(linux_kernel)]
mod statx;
-#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
mod sync;
#[cfg(any(apple, linux_kernel))]
mod xattr;
@@ -60,22 +68,24 @@ pub use at::*;
pub use constants::*;
#[cfg(linux_kernel)]
pub use copy_file_range::copy_file_range;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
+#[cfg(not(target_os = "haiku"))] // Haiku needs <https://github.com/rust-lang/rust/pull/112371>
pub use cwd::*;
-#[cfg(not(target_os = "redox"))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox")))]
pub use dir::{Dir, DirEntry};
#[cfg(not(any(
apple,
netbsdlike,
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
)))]
pub use fadvise::{fadvise, Advice};
pub use fcntl::*;
#[cfg(apple)]
-pub use fcntl_apple::{fcntl_fullfsync, fcntl_rdadvise};
+pub use fcntl_apple::*;
#[cfg(apple)]
pub use fcopyfile::*;
pub use fd::*;
@@ -86,11 +96,17 @@ pub use getpath::getpath;
pub use id::*;
#[cfg(not(target_os = "wasi"))]
pub use ioctl::*;
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub use makedev::*;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
pub use memfd_create::{memfd_create, MemfdFlags};
#[cfg(linux_kernel)]
+#[cfg(feature = "fs")]
pub use mount::*;
#[cfg(linux_kernel)]
pub use openat2::openat2;
@@ -101,7 +117,7 @@ pub use seek_from::SeekFrom;
pub use sendfile::sendfile;
#[cfg(linux_kernel)]
pub use statx::{statx, Statx, StatxFlags, StatxTimestamp};
-#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub use sync::sync;
#[cfg(any(apple, linux_kernel))]
pub use xattr::*;
diff --git a/vendor/rustix/src/fs/mount.rs b/vendor/rustix/src/fs/mount.rs
index 1439b1f32..d1e6a8238 100644
--- a/vendor/rustix/src/fs/mount.rs
+++ b/vendor/rustix/src/fs/mount.rs
@@ -1,166 +1,45 @@
//! Linux `mount`.
-
-use crate::backend::fs::types::{
- InternalMountFlags, MountFlags, MountFlagsArg, MountPropagationFlags, UnmountFlags,
-};
-use crate::{backend, io, path};
-
-/// `mount(source, target, filesystemtype, mountflags, data)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-pub fn mount<Source: path::Arg, Target: path::Arg, Fs: path::Arg, Data: path::Arg>(
- source: Source,
- target: Target,
- file_system_type: Fs,
- flags: MountFlags,
- data: Data,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- file_system_type.into_with_c_str(|file_system_type| {
- data.into_with_c_str(|data| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- Some(file_system_type),
- MountFlagsArg(flags.bits()),
- Some(data),
- )
- })
- })
- })
- })
-}
-
-/// `mount(NULL, target, NULL, MS_REMOUNT | mountflags, data)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn remount<Target: path::Arg, Data: path::Arg>(
- target: Target,
- flags: MountFlags,
- data: Data,
-) -> io::Result<()> {
- target.into_with_c_str(|target| {
- data.into_with_c_str(|data| {
- backend::fs::syscalls::mount(
- None,
- target,
- None,
- MountFlagsArg(InternalMountFlags::REMOUNT.bits() | flags.bits()),
- Some(data),
- )
- })
- })
-}
-
-/// `mount(source, target, NULL, MS_BIND, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn bind_mount<Source: path::Arg, Target: path::Arg>(
- source: Source,
- target: Target,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- None,
- MountFlagsArg(MountFlags::BIND.bits()),
- None,
- )
- })
- })
-}
-
-/// `mount(source, target, NULL, MS_BIND | MS_REC, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn recursive_bind_mount<Source: path::Arg, Target: path::Arg>(
- source: Source,
- target: Target,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- None,
- MountFlagsArg(MountFlags::BIND.bits() | MountPropagationFlags::REC.bits()),
- None,
- )
- })
- })
-}
-
-/// `mount(NULL, target, NULL, mountflags, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn change_mount<Target: path::Arg>(
- target: Target,
- flags: MountPropagationFlags,
-) -> io::Result<()> {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(None, target, None, MountFlagsArg(flags.bits()), None)
- })
-}
-
-/// `mount(source, target, NULL, MS_MOVE, NULL)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
-#[inline]
-#[doc(alias = "mount")]
-pub fn move_mount<Source: path::Arg, Target: path::Arg>(
- source: Source,
- target: Target,
-) -> io::Result<()> {
- source.into_with_c_str(|source| {
- target.into_with_c_str(|target| {
- backend::fs::syscalls::mount(
- Some(source),
- target,
- None,
- MountFlagsArg(InternalMountFlags::MOVE.bits()),
- None,
- )
- })
- })
-}
-
-/// `umount2(target, flags)`
-///
-/// # References
-/// - [Linux]
-///
-/// [Linux]: https://man7.org/linux/man-pages/man2/umount.2.html
-#[doc(alias = "umount", alias = "umount2")]
-pub fn unmount<Target: path::Arg>(target: Target, flags: UnmountFlags) -> io::Result<()> {
- target.into_with_c_str(|target| backend::fs::syscalls::unmount(target, flags))
-}
+//!
+//! These have been moved to a new `rustix::mount` module.
+
+#[deprecated(note = "rustix::fs::UnmountFlags` moved to `rustix::mount::UnmountFlags`.")]
+pub use crate::mount::UnmountFlags;
+
+#[deprecated(note = "rustix::fs::MountFlags` moved to `rustix::mount::MountFlags`.")]
+pub use crate::mount::MountFlags;
+
+#[deprecated(
+ note = "rustix::fs::MountPropagationFlags` moved to `rustix::mount::MountPropagationFlags`."
+)]
+pub use crate::mount::MountPropagationFlags;
+
+#[deprecated(note = "`rustix::fs::mount` moved to `rustix::mount::mount`.")]
+pub use crate::mount::mount;
+
+#[deprecated(note = "`rustix::fs::unmount` moved to `rustix::mount::unmount`.")]
+pub use crate::mount::unmount;
+
+#[deprecated(
+ note = "`rustix::fs::remount` is renamed and moved to `rustix::mount::mount_remount`."
+)]
+pub use crate::mount::mount_remount as remount;
+
+#[deprecated(
+ note = "`rustix::fs::bind_mount` is renamed and moved to `rustix::mount::mount_bind`."
+)]
+pub use crate::mount::mount_bind as bind_mount;
+
+#[deprecated(
+ note = "`rustix::fs::recursive_bind_mount` is renamed and moved to `rustix::mount::mount_recursive_bind`."
+)]
+pub use crate::mount::mount_recursive_bind as recursive_bind_mount;
+
+#[deprecated(
+ note = "`rustix::fs::change_mount` is renamed and moved to `rustix::mount::mount_change`."
+)]
+pub use crate::mount::mount_change as change_mount;
+
+#[deprecated(
+ note = "`rustix::fs::move_mount` is renamed and moved to `rustix::mount::mount_move`."
+)]
+pub use crate::mount::mount_move as move_mount;
diff --git a/vendor/rustix/src/io/dup.rs b/vendor/rustix/src/io/dup.rs
index 428c69f28..9f5186192 100644
--- a/vendor/rustix/src/io/dup.rs
+++ b/vendor/rustix/src/io/dup.rs
@@ -111,7 +111,12 @@ pub fn dup2<Fd: AsFd>(fd: Fd, new: &mut OwnedFd) -> io::Result<()> {
/// [NetBSD]: https://man.netbsd.org/dup3.2
/// [OpenBSD]: https://man.openbsd.org/dup3.2
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=dup3&section=3
-#[cfg(not(any(target_os = "aix", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "aix",
+ target_os = "espidf",
+ target_os = "nto",
+ target_os = "wasi"
+)))]
#[inline]
pub fn dup3<Fd: AsFd>(fd: Fd, new: &mut OwnedFd, flags: DupFlags) -> io::Result<()> {
backend::io::syscalls::dup3(fd.as_fd(), new, flags)
diff --git a/vendor/rustix/src/io/errno.rs b/vendor/rustix/src/io/errno.rs
index 7cb50f229..7640d3111 100644
--- a/vendor/rustix/src/io/errno.rs
+++ b/vendor/rustix/src/io/errno.rs
@@ -1,8 +1,8 @@
//! The `Errno` type, which is a minimal wrapper around an error code.
//!
-//! We define the error constants as individual `const`s instead of an
-//! enum because we may not know about all of the host's error values
-//! and we don't want unrecognized values to create UB.
+//! We define the error constants as individual `const`s instead of an enum
+//! because we may not know about all of the host's error values and we don't
+//! want unrecognized values to create undefined behavior.
use crate::backend;
use core::{fmt, result};
diff --git a/vendor/rustix/src/io/fcntl.rs b/vendor/rustix/src/io/fcntl.rs
index 0454821ff..913e9d062 100644
--- a/vendor/rustix/src/io/fcntl.rs
+++ b/vendor/rustix/src/io/fcntl.rs
@@ -98,7 +98,7 @@ pub fn fcntl_setfd<Fd: AsFd>(fd: Fd, flags: FdFlags) -> io::Result<()> {
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=fcntl&section=2
/// [illumos]: https://illumos.org/man/2/fcntl
/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Control-Operations.html#index-fcntl-function
-#[cfg(not(any(target_os = "wasi", target_os = "espidf")))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "F_DUPFD_CLOEXEC")]
pub fn fcntl_dupfd_cloexec<Fd: AsFd>(fd: Fd, min: RawFd) -> io::Result<OwnedFd> {
diff --git a/vendor/rustix/src/io/ioctl.rs b/vendor/rustix/src/io/ioctl.rs
index 59cbe1ab5..d9bfa1fb3 100644
--- a/vendor/rustix/src/io/ioctl.rs
+++ b/vendor/rustix/src/io/ioctl.rs
@@ -62,6 +62,7 @@ pub fn ioctl_fionbio<Fd: AsFd>(fd: Fd, value: bool) -> io::Result<()> {
/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=ioctl&sektion=2#GENERIC%09IOCTLS
/// [NetBSD]: https://man.netbsd.org/ioctl.2#GENERIC%20IOCTLS
/// [OpenBSD]: https://man.openbsd.org/ioctl.2#GENERIC_IOCTLS
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "FIONREAD")]
pub fn ioctl_fionread<Fd: AsFd>(fd: Fd) -> io::Result<u64> {
diff --git a/vendor/rustix/src/io/read_write.rs b/vendor/rustix/src/io/read_write.rs
index 32cbda225..91a28bc39 100644
--- a/vendor/rustix/src/io/read_write.rs
+++ b/vendor/rustix/src/io/read_write.rs
@@ -138,6 +138,7 @@ pub fn pwrite<Fd: AsFd>(fd: Fd, buf: &[u8], offset: u64) -> io::Result<usize> {
/// [OpenBSD]: https://man.openbsd.org/readv.2
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=readv&section=2
/// [illumos]: https://illumos.org/man/2/readv
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn readv<Fd: AsFd>(fd: Fd, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
backend::io::syscalls::readv(fd.as_fd(), bufs)
@@ -163,6 +164,7 @@ pub fn readv<Fd: AsFd>(fd: Fd, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize>
/// [OpenBSD]: https://man.openbsd.org/writev.2
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=writev&section=2
/// [illumos]: https://illumos.org/man/2/writev
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn writev<Fd: AsFd>(fd: Fd, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
backend::io::syscalls::writev(fd.as_fd(), bufs)
@@ -185,7 +187,13 @@ pub fn writev<Fd: AsFd>(fd: Fd, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
/// [OpenBSD]: https://man.openbsd.org/preadv.2
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=preadv&section=2
/// [illumos]: https://illumos.org/man/2/preadv
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "solaris")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "redox",
+ target_os = "solaris"
+)))]
#[inline]
pub fn preadv<Fd: AsFd>(fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
backend::io::syscalls::preadv(fd.as_fd(), bufs, offset)
@@ -212,7 +220,13 @@ pub fn preadv<Fd: AsFd>(fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io:
/// [OpenBSD]: https://man.openbsd.org/pwritev.2
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=pwritev&section=2
/// [illumos]: https://illumos.org/man/2/pwritev
-#[cfg(not(any(target_os = "haiku", target_os = "redox", target_os = "solaris")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "redox",
+ target_os = "solaris"
+)))]
#[inline]
pub fn pwritev<Fd: AsFd>(fd: Fd, bufs: &[IoSlice<'_>], offset: u64) -> io::Result<usize> {
backend::io::syscalls::pwritev(fd.as_fd(), bufs, offset)
diff --git a/vendor/rustix/src/lib.rs b/vendor/rustix/src/lib.rs
index 3fcf92544..988525e5f 100644
--- a/vendor/rustix/src/lib.rs
+++ b/vendor/rustix/src/lib.rs
@@ -100,14 +100,10 @@
#![cfg_attr(rustc_attrs, feature(rustc_attrs))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(all(wasi_ext, target_os = "wasi", feature = "std"), feature(wasi_ext))]
-#![cfg_attr(
- all(linux_raw, naked_functions, target_arch = "x86"),
- feature(naked_functions)
-)]
#![cfg_attr(core_ffi_c, feature(core_ffi_c))]
#![cfg_attr(core_c_str, feature(core_c_str))]
-#![cfg_attr(alloc_c_string, feature(alloc_ffi))]
#![cfg_attr(alloc_c_string, feature(alloc_c_string))]
+#![cfg_attr(alloc_ffi, feature(alloc_ffi))]
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "rustc-dep-of-std", feature(ip))]
#![cfg_attr(
@@ -127,6 +123,16 @@
#[cfg(not(feature = "rustc-dep-of-std"))]
extern crate alloc;
+// Use `static_assertions` macros if we have them, or a polyfill otherwise.
+#[cfg(all(test, static_assertions))]
+#[macro_use]
+#[allow(unused_imports)]
+extern crate static_assertions;
+#[cfg(all(test, not(static_assertions)))]
+#[macro_use]
+#[allow(unused_imports)]
+mod static_assertions;
+
// Internal utilities.
#[cfg(not(windows))]
#[macro_use]
@@ -149,7 +155,7 @@ pub(crate) mod bitcast;
// versions of libc and not others.
#[cfg(any(
all(linux_raw, feature = "use-libc-auxv"),
- all(libc, not(any(windows, target_os = "wasi")))
+ all(libc, not(any(windows, target_os = "espidf", target_os = "wasi")))
))]
#[macro_use]
mod weak;
@@ -204,21 +210,26 @@ pub mod io;
#[cfg(feature = "io_uring")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "io_uring")))]
pub mod io_uring;
-#[cfg(not(any(windows, target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[cfg(feature = "mm")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "mm")))]
pub mod mm;
+#[cfg(linux_kernel)]
+#[cfg(feature = "mount")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "mount")))]
+pub mod mount;
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
#[cfg(feature = "net")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "net")))]
pub mod net;
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(feature = "param")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "param")))]
pub mod param;
#[cfg(not(windows))]
#[cfg(any(
feature = "fs",
+ feature = "mount",
feature = "net",
all(
linux_raw,
@@ -232,7 +243,10 @@ pub mod param;
)
)
))]
-#[cfg_attr(doc_cfg, doc(cfg(any(feature = "fs", feature = "net"))))]
+#[cfg_attr(
+ doc_cfg,
+ doc(cfg(any(feature = "fs", feature = "mount", feature = "net")))
+)]
pub mod path;
#[cfg(feature = "pipe")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "pipe")))]
@@ -271,7 +285,7 @@ pub mod termios;
#[cfg(feature = "thread")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "thread")))]
pub mod thread;
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(feature = "time")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "time")))]
pub mod time;
@@ -284,8 +298,14 @@ pub mod time;
#[cfg_attr(doc_cfg, doc(cfg(feature = "runtime")))]
pub mod runtime;
+// Temporarily provide some mount functions for use in the fs module for
+// backwards compatibility.
+#[cfg(linux_kernel)]
+#[cfg(all(feature = "fs", not(feature = "mount")))]
+pub(crate) mod mount;
+
// Private modules used by multiple public modules.
-#[cfg(not(windows))]
+#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(any(feature = "thread", feature = "time", target_arch = "x86"))]
mod clockid;
#[cfg(not(any(windows, target_os = "wasi")))]
@@ -301,7 +321,7 @@ mod pid;
#[cfg(any(feature = "process", feature = "thread"))]
#[cfg(linux_kernel)]
mod prctl;
-#[cfg(not(any(windows, target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[cfg(any(feature = "process", feature = "runtime", all(bsd, feature = "event")))]
mod signal;
#[cfg(not(windows))]
diff --git a/vendor/rustix/src/mm/mmap.rs b/vendor/rustix/src/mm/mmap.rs
index bec15f0ad..02badb9fd 100644
--- a/vendor/rustix/src/mm/mmap.rs
+++ b/vendor/rustix/src/mm/mmap.rs
@@ -222,7 +222,8 @@ pub unsafe fn mprotect(ptr: *mut c_void, len: usize, flags: MprotectFlags) -> io
///
/// Some implementations implicitly round the memory region out to the nearest
/// page boundaries, so this function may lock more memory than explicitly
-/// requested if the memory isn't page-aligned.
+/// requested if the memory isn't page-aligned. Other implementations fail if
+/// the memory isn't page-aligned.
///
/// # References
/// - [POSIX]
diff --git a/vendor/rustix/src/mount/fsopen.rs b/vendor/rustix/src/mount/fsopen.rs
new file mode 100644
index 000000000..581f03782
--- /dev/null
+++ b/vendor/rustix/src/mount/fsopen.rs
@@ -0,0 +1,219 @@
+//! `fsopen` and related functions in Linux's `mount` API.
+
+use crate::backend::mount::types::{
+ FsMountFlags, FsOpenFlags, FsPickFlags, MountAttrFlags, MoveMountFlags, OpenTreeFlags,
+};
+use crate::fd::{BorrowedFd, OwnedFd};
+use crate::{backend, io, path};
+
+/// `fsopen(fs_name, flags)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsopen.md
+#[inline]
+pub fn fsopen<Fs: path::Arg>(fs_name: Fs, flags: FsOpenFlags) -> io::Result<OwnedFd> {
+ fs_name.into_with_c_str(|fs_name| backend::mount::syscalls::fsopen(fs_name, flags))
+}
+
+/// `fsmount(fs_fd, flags, attr_flags)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsmount.md
+#[inline]
+pub fn fsmount(
+ fs_fd: BorrowedFd<'_>,
+ flags: FsMountFlags,
+ attr_flags: MountAttrFlags,
+) -> io::Result<()> {
+ backend::mount::syscalls::fsmount(fs_fd, flags, attr_flags)
+}
+
+/// `move_mount(from_dfd, from_pathname, to_dfd, to_pathname, flags)`
+///
+/// This is not the same as `mount` with the `MS_MOVE` flag. If you want to
+/// use that, use [`mount_move`] instead.
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [`mount_move`]: crate::mount::mount_move
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/move_mount.md
+#[inline]
+pub fn move_mount<From: path::Arg, To: path::Arg>(
+ from_dfd: BorrowedFd<'_>,
+ from_pathname: From,
+ to_dfd: BorrowedFd<'_>,
+ to_pathname: To,
+ flags: MoveMountFlags,
+) -> io::Result<()> {
+ from_pathname.into_with_c_str(|from_pathname| {
+ to_pathname.into_with_c_str(|to_pathname| {
+ backend::mount::syscalls::move_mount(
+ from_dfd,
+ from_pathname,
+ to_dfd,
+ to_pathname,
+ flags,
+ )
+ })
+ })
+}
+
+/// `open_tree(dfd, filename, flags)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/open_tree.md
+#[inline]
+pub fn open_tree<Path: path::Arg>(
+ dfd: BorrowedFd<'_>,
+ filename: Path,
+ flags: OpenTreeFlags,
+) -> io::Result<OwnedFd> {
+ filename.into_with_c_str(|filename| backend::mount::syscalls::open_tree(dfd, filename, flags))
+}
+
+/// `fspick(dfd, path, flags)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fspick.md
+#[inline]
+pub fn fspick<Path: path::Arg>(
+ dfd: BorrowedFd<'_>,
+ path: Path,
+ flags: FsPickFlags,
+) -> io::Result<OwnedFd> {
+ path.into_with_c_str(|path| backend::mount::syscalls::fspick(dfd, path, flags))
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_SET_FLAG, key, NULL, 0)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_set_flag<Key: path::Arg>(fs_fd: BorrowedFd<'_>, key: Key) -> io::Result<()> {
+ key.into_with_c_str(|key| backend::mount::syscalls::fsconfig_set_flag(fs_fd, key))
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_SET_STRING, key, value, 0)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_set_string<Key: path::Arg, Value: path::Arg>(
+ fs_fd: BorrowedFd<'_>,
+ key: Key,
+ value: Value,
+) -> io::Result<()> {
+ key.into_with_c_str(|key| {
+ value.into_with_c_str(|value| {
+ backend::mount::syscalls::fsconfig_set_string(fs_fd, key, value)
+ })
+ })
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_SET_BINARY, key, value, value.len())`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_set_binary<Key: path::Arg>(
+ fs_fd: BorrowedFd<'_>,
+ key: Key,
+ value: &[u8],
+) -> io::Result<()> {
+ key.into_with_c_str(|key| backend::mount::syscalls::fsconfig_set_binary(fs_fd, key, value))
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_SET_PATH, key, path, fd)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_set_path<Key: path::Arg, Path: path::Arg>(
+ fs_fd: BorrowedFd<'_>,
+ key: Key,
+ path: Path,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ key.into_with_c_str(|key| {
+ path.into_with_c_str(|path| {
+ backend::mount::syscalls::fsconfig_set_path(fs_fd, key, path, fd)
+ })
+ })
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_SET_PATH_EMPTY, key, "", fd)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_set_path_empty<Key: path::Arg>(
+ fs_fd: BorrowedFd<'_>,
+ key: Key,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ key.into_with_c_str(|key| backend::mount::syscalls::fsconfig_set_path_empty(fs_fd, key, fd))
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_SET_FD, key, NULL, fd)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_set_fd<Key: path::Arg>(
+ fs_fd: BorrowedFd<'_>,
+ key: Key,
+ fd: BorrowedFd<'_>,
+) -> io::Result<()> {
+ key.into_with_c_str(|key| backend::mount::syscalls::fsconfig_set_fd(fs_fd, key, fd))
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_CMD_CREATE, key, NULL, 0)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_create(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ backend::mount::syscalls::fsconfig_create(fs_fd)
+}
+
+/// `fsconfig(fs_fd, FSCONFIG_CMD_RECONFIGURE, key, NULL, 0)`
+///
+/// # References
+/// - [Unfinished draft]
+///
+/// [Unfinished draft]: https://github.com/sunfishcode/linux-mount-api-documentation/blob/main/fsconfig.md
+#[inline]
+#[doc(alias = "fsconfig")]
+pub fn fsconfig_reconfigure(fs_fd: BorrowedFd<'_>) -> io::Result<()> {
+ backend::mount::syscalls::fsconfig_reconfigure(fs_fd)
+}
diff --git a/vendor/rustix/src/mount/mod.rs b/vendor/rustix/src/mount/mod.rs
new file mode 100644
index 000000000..9b4f6da51
--- /dev/null
+++ b/vendor/rustix/src/mount/mod.rs
@@ -0,0 +1,19 @@
+//! Linux `mount` API.
+
+// The `mount` module includes the `mount` function and related
+// functions which were originally defined in `rustix::fs` but are
+// now replaced by deprecated aliases. After the next semver bump,
+// we can remove the aliases and all the `#[cfg(feature = "mount")]`
+// here and in src/backend/*/mount.
+//
+// The `fsopen` module includes `fsopen` and related functions.
+
+#[cfg(feature = "mount")]
+mod fsopen;
+mod mount_unmount;
+mod types;
+
+#[cfg(feature = "mount")]
+pub use fsopen::*;
+pub use mount_unmount::*;
+pub use types::*;
diff --git a/vendor/rustix/src/mount/mount_unmount.rs b/vendor/rustix/src/mount/mount_unmount.rs
new file mode 100644
index 000000000..ebb517332
--- /dev/null
+++ b/vendor/rustix/src/mount/mount_unmount.rs
@@ -0,0 +1,175 @@
+//! Linux `mount`.
+
+use crate::backend::mount::types::{
+ InternalMountFlags, MountFlags, MountFlagsArg, MountPropagationFlags, UnmountFlags,
+};
+use crate::{backend, io, path};
+
+/// `mount(source, target, filesystemtype, mountflags, data)`
+///
+/// # References
+/// - [Linux]
+///
+/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
+#[inline]
+pub fn mount<Source: path::Arg, Target: path::Arg, Fs: path::Arg, Data: path::Arg>(
+ source: Source,
+ target: Target,
+ file_system_type: Fs,
+ flags: MountFlags,
+ data: Data,
+) -> io::Result<()> {
+ source.into_with_c_str(|source| {
+ target.into_with_c_str(|target| {
+ file_system_type.into_with_c_str(|file_system_type| {
+ data.into_with_c_str(|data| {
+ backend::mount::syscalls::mount(
+ Some(source),
+ target,
+ Some(file_system_type),
+ MountFlagsArg(flags.bits()),
+ Some(data),
+ )
+ })
+ })
+ })
+ })
+}
+
+/// `mount(NULL, target, NULL, MS_REMOUNT | mountflags, data)`
+///
+/// # References
+/// - [Linux]
+///
+/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
+#[inline]
+#[doc(alias = "mount")]
+#[doc(alias = "MS_REMOUNT")]
+pub fn mount_remount<Target: path::Arg, Data: path::Arg>(
+ target: Target,
+ flags: MountFlags,
+ data: Data,
+) -> io::Result<()> {
+ target.into_with_c_str(|target| {
+ data.into_with_c_str(|data| {
+ backend::mount::syscalls::mount(
+ None,
+ target,
+ None,
+ MountFlagsArg(InternalMountFlags::REMOUNT.bits() | flags.bits()),
+ Some(data),
+ )
+ })
+ })
+}
+
+/// `mount(source, target, NULL, MS_BIND, NULL)`
+///
+/// # References
+/// - [Linux]
+///
+/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
+#[inline]
+#[doc(alias = "mount")]
+#[doc(alias = "MS_BIND")]
+pub fn mount_bind<Source: path::Arg, Target: path::Arg>(
+ source: Source,
+ target: Target,
+) -> io::Result<()> {
+ source.into_with_c_str(|source| {
+ target.into_with_c_str(|target| {
+ backend::mount::syscalls::mount(
+ Some(source),
+ target,
+ None,
+ MountFlagsArg(MountFlags::BIND.bits()),
+ None,
+ )
+ })
+ })
+}
+
+/// `mount(source, target, NULL, MS_BIND | MS_REC, NULL)`
+///
+/// # References
+/// - [Linux]
+///
+/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
+#[inline]
+#[doc(alias = "mount")]
+#[doc(alias = "MS_REC")]
+pub fn mount_recursive_bind<Source: path::Arg, Target: path::Arg>(
+ source: Source,
+ target: Target,
+) -> io::Result<()> {
+ source.into_with_c_str(|source| {
+ target.into_with_c_str(|target| {
+ backend::mount::syscalls::mount(
+ Some(source),
+ target,
+ None,
+ MountFlagsArg(MountFlags::BIND.bits() | MountPropagationFlags::REC.bits()),
+ None,
+ )
+ })
+ })
+}
+
+/// `mount(NULL, target, NULL, mountflags, NULL)`
+///
+/// # References
+/// - [Linux]
+///
+/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
+#[inline]
+#[doc(alias = "mount")]
+pub fn mount_change<Target: path::Arg>(
+ target: Target,
+ flags: MountPropagationFlags,
+) -> io::Result<()> {
+ target.into_with_c_str(|target| {
+ backend::mount::syscalls::mount(None, target, None, MountFlagsArg(flags.bits()), None)
+ })
+}
+
+/// `mount(source, target, NULL, MS_MOVE, NULL)`
+///
+/// This is not the same as the `move_mount` syscall. If you want to use that,
+/// use [`move_mount`] instead.
+///
+/// # References
+/// - [Linux]
+///
+/// [`move_mount`]: crate::mount::move_mount
+/// [Linux]: https://man7.org/linux/man-pages/man2/mount.2.html
+#[inline]
+#[doc(alias = "mount")]
+#[doc(alias = "MS_MOVE")]
+pub fn mount_move<Source: path::Arg, Target: path::Arg>(
+ source: Source,
+ target: Target,
+) -> io::Result<()> {
+ source.into_with_c_str(|source| {
+ target.into_with_c_str(|target| {
+ backend::mount::syscalls::mount(
+ Some(source),
+ target,
+ None,
+ MountFlagsArg(InternalMountFlags::MOVE.bits()),
+ None,
+ )
+ })
+ })
+}
+
+/// `umount2(target, flags)`
+///
+/// # References
+/// - [Linux]
+///
+/// [Linux]: https://man7.org/linux/man-pages/man2/umount.2.html
+#[inline]
+#[doc(alias = "umount", alias = "umount2")]
+pub fn unmount<Target: path::Arg>(target: Target, flags: UnmountFlags) -> io::Result<()> {
+ target.into_with_c_str(|target| backend::mount::syscalls::unmount(target, flags))
+}
diff --git a/vendor/rustix/src/mount/types.rs b/vendor/rustix/src/mount/types.rs
new file mode 100644
index 000000000..6096e76d2
--- /dev/null
+++ b/vendor/rustix/src/mount/types.rs
@@ -0,0 +1 @@
+pub use crate::backend::mount::types::*;
diff --git a/vendor/rustix/src/net/send_recv/mod.rs b/vendor/rustix/src/net/send_recv/mod.rs
index 2d55c7f94..1dedd99cb 100644
--- a/vendor/rustix/src/net/send_recv/mod.rs
+++ b/vendor/rustix/src/net/send_recv/mod.rs
@@ -8,10 +8,10 @@ use backend::fd::{AsFd, BorrowedFd};
pub use backend::net::send_recv::{RecvFlags, SendFlags};
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
mod msg;
-#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))]
pub use msg::*;
/// `recv(fd, buf, flags)`—Reads data from a socket.
diff --git a/vendor/rustix/src/net/send_recv/msg.rs b/vendor/rustix/src/net/send_recv/msg.rs
index 916f2a3db..5fefb2e24 100644
--- a/vendor/rustix/src/net/send_recv/msg.rs
+++ b/vendor/rustix/src/net/send_recv/msg.rs
@@ -107,11 +107,15 @@ impl<'buf, 'slice, 'fd> SendAncillaryBuffer<'buf, 'slice, 'fd> {
/// Returns a pointer to the message data.
pub(crate) fn as_control_ptr(&mut self) -> *mut u8 {
- if self.length > 0 {
- self.buffer.as_mut_ptr()
- } else {
- ptr::null_mut()
+ // When the length is zero, we may be using a `&[]` address, which
+ // may be an invalid but non-null pointer, and on some platforms, that
+ // causes `sendmsg` to fail with `EFAULT` or `EINVAL`
+ #[cfg(not(linux_kernel))]
+ if self.length == 0 {
+ return core::ptr::null_mut();
}
+
+ self.buffer.as_mut_ptr()
}
/// Returns the length of the message data.
@@ -223,6 +227,14 @@ impl<'buf> RecvAncillaryBuffer<'buf> {
/// Returns a pointer to the message data.
pub(crate) fn as_control_ptr(&mut self) -> *mut u8 {
+ // When the length is zero, we may be using a `&[]` address, which
+ // may be an invalid but non-null pointer, and on some platforms, that
+ // causes `sendmsg` to fail with `EFAULT` or `EINVAL`
+ #[cfg(not(linux_kernel))]
+ if self.buffer.is_empty() {
+ return core::ptr::null_mut();
+ }
+
self.buffer.as_mut_ptr()
}
diff --git a/vendor/rustix/src/net/sockopt.rs b/vendor/rustix/src/net/sockopt.rs
index 53e73e64b..b21d4a35c 100644
--- a/vendor/rustix/src/net/sockopt.rs
+++ b/vendor/rustix/src/net/sockopt.rs
@@ -1632,9 +1632,8 @@ pub fn get_tcp_nodelay<Fd: AsFd>(fd: Fd) -> io::Result<bool> {
#[test]
fn test_sizes() {
use c::c_int;
- use core::mem::size_of;
// Backend code needs to cast these to `c_int` so make sure that cast
// isn't lossy.
- assert_eq!(size_of::<Timeout>(), size_of::<c_int>());
+ assert_eq_size!(Timeout, c_int);
}
diff --git a/vendor/rustix/src/net/types.rs b/vendor/rustix/src/net/types.rs
index 95fa931a1..a2c019b42 100644
--- a/vendor/rustix/src/net/types.rs
+++ b/vendor/rustix/src/net/types.rs
@@ -23,13 +23,15 @@ impl SocketType {
pub const DGRAM: Self = Self(c::SOCK_DGRAM as _);
/// `SOCK_SEQPACKET`
+ #[cfg(not(target_os = "espidf"))]
pub const SEQPACKET: Self = Self(c::SOCK_SEQPACKET as _);
/// `SOCK_RAW`
+ #[cfg(not(target_os = "espidf"))]
pub const RAW: Self = Self(c::SOCK_RAW as _);
/// `SOCK_RDM`
- #[cfg(not(target_os = "haiku"))]
+ #[cfg(not(any(target_os = "espidf", target_os = "haiku")))]
pub const RDM: Self = Self(c::SOCK_RDM as _);
/// Constructs a `SocketType` from a raw integer.
@@ -83,7 +85,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const NETLINK: Self = Self(c::AF_NETLINK as _);
/// `AF_UNIX`, aka `AF_LOCAL`
@@ -94,19 +98,25 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const AX25: Self = Self(c::AF_AX25 as _);
/// `AF_IPX`
+ #[cfg(not(target_os = "espidf"))]
pub const IPX: Self = Self(c::AF_IPX as _);
/// `AF_APPLETALK`
+ #[cfg(not(target_os = "espidf"))]
pub const APPLETALK: Self = Self(c::AF_APPLETALK as _);
/// `AF_NETROM`
#[cfg(not(any(
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const NETROM: Self = Self(c::AF_NETROM as _);
/// `AF_BRIDGE`
@@ -114,7 +124,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const BRIDGE: Self = Self(c::AF_BRIDGE as _);
/// `AF_ATMPVC`
@@ -122,14 +134,18 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const ATMPVC: Self = Self(c::AF_ATMPVC as _);
/// `AF_X25`
#[cfg(not(any(
bsd,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const X25: Self = Self(c::AF_X25 as _);
/// `AF_ROSE`
@@ -137,18 +153,22 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const ROSE: Self = Self(c::AF_ROSE as _);
/// `AF_DECnet`
- #[cfg(not(target_os = "haiku"))]
+ #[cfg(not(any(target_os = "espidf", target_os = "haiku")))]
pub const DECnet: Self = Self(c::AF_DECnet as _);
/// `AF_NETBEUI`
#[cfg(not(any(
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const NETBEUI: Self = Self(c::AF_NETBEUI as _);
/// `AF_SECURITY`
@@ -156,14 +176,18 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const SECURITY: Self = Self(c::AF_SECURITY as _);
/// `AF_KEY`
#[cfg(not(any(
bsd,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const KEY: Self = Self(c::AF_KEY as _);
/// `AF_PACKET`
@@ -175,7 +199,9 @@ impl AddressFamily {
#[cfg(not(any(
bsd,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const PACKET: Self = Self(c::AF_PACKET as _);
/// `AF_ASH`
@@ -183,7 +209,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const ASH: Self = Self(c::AF_ASH as _);
/// `AF_ECONET`
@@ -191,7 +219,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const ECONET: Self = Self(c::AF_ECONET as _);
/// `AF_ATMSVC`
@@ -199,7 +229,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const ATMSVC: Self = Self(c::AF_ATMSVC as _);
/// `AF_RDS`
@@ -207,17 +239,21 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const RDS: Self = Self(c::AF_RDS as _);
/// `AF_SNA`
- #[cfg(not(target_os = "haiku"))]
+ #[cfg(not(any(target_os = "espidf", target_os = "haiku")))]
pub const SNA: Self = Self(c::AF_SNA as _);
/// `AF_IRDA`
#[cfg(not(any(
bsd,
solarish,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const IRDA: Self = Self(c::AF_IRDA as _);
/// `AF_PPPOX`
@@ -225,7 +261,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const PPPOX: Self = Self(c::AF_PPPOX as _);
/// `AF_WANPIPE`
@@ -233,7 +271,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const WANPIPE: Self = Self(c::AF_WANPIPE as _);
/// `AF_LLC`
@@ -241,7 +281,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const LLC: Self = Self(c::AF_LLC as _);
/// `AF_CAN`
@@ -249,7 +291,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const CAN: Self = Self(c::AF_CAN as _);
/// `AF_TIPC`
@@ -257,18 +301,22 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const TIPC: Self = Self(c::AF_TIPC as _);
/// `AF_BLUETOOTH`
- #[cfg(not(any(apple, solarish, windows)))]
+ #[cfg(not(any(apple, solarish, windows, target_os = "espidf")))]
pub const BLUETOOTH: Self = Self(c::AF_BLUETOOTH as _);
/// `AF_IUCV`
#[cfg(not(any(
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const IUCV: Self = Self(c::AF_IUCV as _);
/// `AF_RXRPC`
@@ -276,18 +324,22 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const RXRPC: Self = Self(c::AF_RXRPC as _);
/// `AF_ISDN`
- #[cfg(not(any(solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(solarish, windows, target_os = "espidf", target_os = "haiku")))]
pub const ISDN: Self = Self(c::AF_ISDN as _);
/// `AF_PHONET`
#[cfg(not(any(
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const PHONET: Self = Self(c::AF_PHONET as _);
/// `AF_IEEE802154`
@@ -295,7 +347,9 @@ impl AddressFamily {
bsd,
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const IEEE802154: Self = Self(c::AF_IEEE802154 as _);
/// `AF_802`
@@ -508,28 +562,28 @@ pub mod ipproto {
pub const ICMP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_ICMP as _) });
/// `IPPROTO_IGMP`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const IGMP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_IGMP as _) });
/// `IPPROTO_IPIP`
- #[cfg(not(any(solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(solarish, windows, target_os = "espidf", target_os = "haiku")))]
pub const IPIP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_IPIP as _) });
/// `IPPROTO_TCP`
pub const TCP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_TCP as _) });
/// `IPPROTO_EGP`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const EGP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_EGP as _) });
/// `IPPROTO_PUP`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const PUP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_PUP as _) });
/// `IPPROTO_UDP`
pub const UDP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_UDP as _) });
/// `IPPROTO_IDP`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const IDP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_IDP as _) });
/// `IPPROTO_TP`
- #[cfg(not(any(solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(solarish, windows, target_os = "espidf", target_os = "haiku")))]
pub const TP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_TP as _) });
/// `IPPROTO_DCCP`
#[cfg(not(any(
@@ -537,7 +591,9 @@ pub mod ipproto {
solarish,
windows,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
target_os = "openbsd",
)))]
pub const DCCP: Protocol =
@@ -546,40 +602,62 @@ pub mod ipproto {
pub const IPV6: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_IPV6 as _) });
/// `IPPROTO_RSVP`
- #[cfg(not(any(solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(solarish, windows, target_os = "espidf", target_os = "haiku")))]
pub const RSVP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_RSVP as _) });
/// `IPPROTO_GRE`
- #[cfg(not(any(solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(solarish, windows, target_os = "espidf", target_os = "haiku")))]
pub const GRE: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_GRE as _) });
/// `IPPROTO_ESP`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const ESP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_ESP as _) });
/// `IPPROTO_AH`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const AH: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_AH as _) });
/// `IPPROTO_MTP`
- #[cfg(not(any(solarish, netbsdlike, windows, target_os = "haiku")))]
+ #[cfg(not(any(
+ solarish,
+ netbsdlike,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto",
+ )))]
pub const MTP: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_MTP as _) });
/// `IPPROTO_BEETPH`
- #[cfg(not(any(bsd, solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
pub const BEETPH: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_BEETPH as _) });
/// `IPPROTO_ENCAP`
- #[cfg(not(any(solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(solarish, windows, target_os = "espidf", target_os = "haiku")))]
pub const ENCAP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_ENCAP as _) });
/// `IPPROTO_PIM`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const PIM: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_PIM as _) });
/// `IPPROTO_COMP`
- #[cfg(not(any(bsd, solarish, windows, target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ windows,
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
pub const COMP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_COMP as _) });
/// `IPPROTO_SCTP`
#[cfg(not(any(
solarish,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "openbsd"
)))]
@@ -592,7 +670,9 @@ pub mod ipproto {
solarish,
windows,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const UDPLITE: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_UDPLITE as _) });
@@ -602,8 +682,10 @@ pub mod ipproto {
solarish,
windows,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
target_os = "netbsd",
+ target_os = "nto",
)))]
pub const MPLS: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_MPLS as _) });
@@ -612,6 +694,7 @@ pub mod ipproto {
pub const ETHERNET: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_ETHERNET as _) });
/// `IPPROTO_RAW`
+ #[cfg(not(target_os = "espidf"))]
pub const RAW: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_RAW as _) });
/// `IPPROTO_MPTCP`
#[cfg(not(any(
@@ -619,13 +702,15 @@ pub mod ipproto {
solarish,
windows,
target_os = "emscripten",
+ target_os = "espidf",
target_os = "fuchsia",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const MPTCP: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_MPTCP as _) });
/// `IPPROTO_FRAGMENT`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const FRAGMENT: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_FRAGMENT as _) });
/// `IPPROTO_ICMPV6`
@@ -638,11 +723,13 @@ pub mod ipproto {
solarish,
windows,
target_os = "dragonfly",
+ target_os = "espidf",
target_os = "haiku",
+ target_os = "nto",
)))]
pub const MH: Protocol = Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_MH as _) });
/// `IPPROTO_ROUTING`
- #[cfg(not(any(solarish, target_os = "haiku")))]
+ #[cfg(not(any(solarish, target_os = "espidf", target_os = "haiku")))]
pub const ROUTING: Protocol =
Protocol(unsafe { RawProtocol::new_unchecked(c::IPPROTO_ROUTING as _) });
}
@@ -1274,7 +1361,7 @@ bitflags! {
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct SocketFlags: c::c_uint {
/// `SOCK_NONBLOCK`
- #[cfg(not(any(apple, windows, target_os = "haiku")))]
+ #[cfg(not(any(apple, windows, target_os = "espidf", target_os = "haiku", target_os = "nto")))]
const NONBLOCK = bitcast!(c::SOCK_NONBLOCK);
/// `SOCK_CLOEXEC`
@@ -1286,14 +1373,25 @@ bitflags! {
#[test]
fn test_sizes() {
use c::c_int;
- use core::mem::size_of;
+ use core::mem::transmute;
// Backend code needs to cast these to `c_int` so make sure that cast
// isn't lossy.
- assert_eq!(size_of::<RawProtocol>(), size_of::<c_int>());
- assert_eq!(size_of::<Protocol>(), size_of::<c_int>());
- assert_eq!(size_of::<Option<Protocol>>(), size_of::<c_int>());
- assert_eq!(size_of::<RawSocketType>(), size_of::<c_int>());
- assert_eq!(size_of::<SocketType>(), size_of::<c_int>());
- assert_eq!(size_of::<SocketFlags>(), size_of::<c_int>());
+ assert_eq_size!(RawProtocol, c_int);
+ assert_eq_size!(Protocol, c_int);
+ assert_eq_size!(Option<RawProtocol>, c_int);
+ assert_eq_size!(Option<Protocol>, c_int);
+ assert_eq_size!(RawSocketType, c_int);
+ assert_eq_size!(SocketType, c_int);
+ assert_eq_size!(SocketFlags, c_int);
+
+ // Rustix doesn't depend on `Option<Protocol>` matching the ABI of
+ // a raw integer for correctness, but it should work nonetheless.
+ unsafe {
+ let t: Option<Protocol> = None;
+ assert_eq!(0_u32, transmute(t));
+
+ let t: Option<Protocol> = Some(Protocol::from_raw(RawProtocol::new(4567).unwrap()));
+ assert_eq!(4567_u32, transmute(t));
+ }
}
diff --git a/vendor/rustix/src/pid.rs b/vendor/rustix/src/pid.rs
index bebc1f00c..1b1da6521 100644
--- a/vendor/rustix/src/pid.rs
+++ b/vendor/rustix/src/pid.rs
@@ -86,8 +86,18 @@ impl Pid {
#[test]
fn test_sizes() {
- use core::mem::size_of;
+ use core::mem::transmute;
- assert_eq!(size_of::<RawPid>(), size_of::<NonZeroI32>());
- assert_eq!(size_of::<RawPid>(), size_of::<Pid>());
+ assert_eq_size!(RawPid, NonZeroI32);
+ assert_eq_size!(RawPid, Pid);
+ assert_eq_size!(RawPid, Option<Pid>);
+
+ // Rustix doesn't depend on `Option<Pid>` matching the ABI of a raw integer
+ // for correctness, but it should work nonetheless.
+ const_assert_eq!(0 as RawPid, unsafe {
+ transmute::<Option<Pid>, RawPid>(None)
+ });
+ const_assert_eq!(4567 as RawPid, unsafe {
+ transmute::<Option<Pid>, RawPid>(Some(Pid::from_raw_unchecked(4567)))
+ });
}
diff --git a/vendor/rustix/src/pipe.rs b/vendor/rustix/src/pipe.rs
index a4c300abd..1817401c2 100644
--- a/vendor/rustix/src/pipe.rs
+++ b/vendor/rustix/src/pipe.rs
@@ -11,6 +11,7 @@ use crate::{backend, io};
#[cfg(not(any(
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
target_os = "wasi",
@@ -36,6 +37,7 @@ pub use backend::pipe::types::{IoSliceRaw, SpliceFlags};
#[cfg(not(any(
solarish,
windows,
+ target_os = "espidf",
target_os = "haiku",
target_os = "redox",
target_os = "wasi",
@@ -91,7 +93,13 @@ pub fn pipe() -> io::Result<(OwnedFd, OwnedFd)> {
/// [OpenBSD]: https://man.openbsd.org/pipe2.2
/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=pipe2&section=2
/// [illumos]: https://illumos.org/man/2/pipe2
-#[cfg(not(any(apple, target_os = "aix", target_os = "haiku")))]
+#[cfg(not(any(
+ apple,
+ target_os = "aix",
+ target_os = "espidf",
+ target_os = "haiku",
+ target_os = "nto"
+)))]
#[inline]
#[doc(alias = "pipe2")]
pub fn pipe_with(flags: PipeFlags) -> io::Result<(OwnedFd, OwnedFd)> {
diff --git a/vendor/rustix/src/process/exit.rs b/vendor/rustix/src/process/exit.rs
index 2bbbcf538..5533dbabb 100644
--- a/vendor/rustix/src/process/exit.rs
+++ b/vendor/rustix/src/process/exit.rs
@@ -32,5 +32,5 @@ pub const EXIT_FAILURE: i32 = backend::process::types::EXIT_FAILURE;
///
/// [Linux]: https://tldp.org/LDP/abs/html/exitcodes.html
/// [`Signal::Abort`]: crate::process::Signal::Abort
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub const EXIT_SIGNALED_SIGABRT: i32 = backend::process::types::EXIT_SIGNALED_SIGABRT;
diff --git a/vendor/rustix/src/process/ioctl.rs b/vendor/rustix/src/process/ioctl.rs
index 46dbbc59b..cde6b5b3c 100644
--- a/vendor/rustix/src/process/ioctl.rs
+++ b/vendor/rustix/src/process/ioctl.rs
@@ -13,7 +13,7 @@ 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 = "redox", target_os = "wasi")))]
#[inline]
#[doc(alias = "TIOCSCTTY")]
pub fn ioctl_tiocsctty<Fd: AsFd>(fd: Fd) -> io::Result<()> {
diff --git a/vendor/rustix/src/process/mod.rs b/vendor/rustix/src/process/mod.rs
index 7a189b013..9c62f127e 100644
--- a/vendor/rustix/src/process/mod.rs
+++ b/vendor/rustix/src/process/mod.rs
@@ -7,8 +7,9 @@ mod chroot;
mod exit;
#[cfg(not(target_os = "wasi"))] // WASI doesn't have get[gpu]id.
mod id;
+#[cfg(not(target_os = "espidf"))]
mod ioctl;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
mod kill;
#[cfg(linux_kernel)]
mod membarrier;
@@ -22,14 +23,19 @@ mod prctl;
mod priority;
#[cfg(freebsdlike)]
mod procctl;
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
mod rlimit;
#[cfg(any(linux_kernel, target_os = "dragonfly", target_os = "fuchsia"))]
mod sched;
mod sched_yield;
#[cfg(not(target_os = "wasi"))] // WASI doesn't have umask.
mod umask;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
mod wait;
#[cfg(not(target_os = "wasi"))]
@@ -39,8 +45,9 @@ pub use chroot::*;
pub use exit::*;
#[cfg(not(target_os = "wasi"))]
pub use id::*;
+#[cfg(not(target_os = "espidf"))]
pub use ioctl::*;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use kill::*;
#[cfg(linux_kernel)]
pub use membarrier::*;
@@ -54,12 +61,17 @@ pub use prctl::*;
pub use priority::*;
#[cfg(freebsdlike)]
pub use procctl::*;
-#[cfg(not(any(target_os = "fuchsia", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "espidf",
+ target_os = "fuchsia",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
pub use rlimit::*;
#[cfg(any(linux_kernel, target_os = "dragonfly", target_os = "fuchsia"))]
pub use sched::*;
pub use sched_yield::sched_yield;
#[cfg(not(target_os = "wasi"))]
pub use umask::*;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use wait::*;
diff --git a/vendor/rustix/src/process/priority.rs b/vendor/rustix/src/process/priority.rs
index 604614ef0..7c2928408 100644
--- a/vendor/rustix/src/process/priority.rs
+++ b/vendor/rustix/src/process/priority.rs
@@ -1,3 +1,4 @@
+#[cfg(not(target_os = "espidf"))]
use crate::process::{Pid, Uid};
use crate::{backend, io};
@@ -25,6 +26,7 @@ pub fn nice(inc: i32) -> io::Result<i32> {
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpriority.html
/// [Linux]: https://man7.org/linux/man-pages/man2/getpriority.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setpriority.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "getpriority")]
pub fn getpriority_user(uid: Uid) -> io::Result<i32> {
@@ -44,6 +46,7 @@ pub fn getpriority_user(uid: Uid) -> io::Result<i32> {
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpriority.html
/// [Linux]: https://man7.org/linux/man-pages/man2/getpriority.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setpriority.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "getpriority")]
pub fn getpriority_pgrp(pgid: Option<Pid>) -> io::Result<i32> {
@@ -63,6 +66,7 @@ pub fn getpriority_pgrp(pgid: Option<Pid>) -> io::Result<i32> {
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpriority.html
/// [Linux]: https://man7.org/linux/man-pages/man2/getpriority.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setpriority.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "getpriority")]
pub fn getpriority_process(pid: Option<Pid>) -> io::Result<i32> {
@@ -80,6 +84,7 @@ pub fn getpriority_process(pid: Option<Pid>) -> io::Result<i32> {
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpriority.html
/// [Linux]: https://man7.org/linux/man-pages/man2/setpriority.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setpriority.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "setpriority")]
pub fn setpriority_user(uid: Uid, priority: i32) -> io::Result<()> {
@@ -99,6 +104,7 @@ pub fn setpriority_user(uid: Uid, priority: i32) -> io::Result<()> {
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpriority.html
/// [Linux]: https://man7.org/linux/man-pages/man2/setpriority.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setpriority.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "setpriority")]
pub fn setpriority_pgrp(pgid: Option<Pid>, priority: i32) -> io::Result<()> {
@@ -118,6 +124,7 @@ pub fn setpriority_pgrp(pgid: Option<Pid>, priority: i32) -> io::Result<()> {
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpriority.html
/// [Linux]: https://man7.org/linux/man-pages/man2/setpriority.2.html
/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setpriority.2.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "setpriority")]
pub fn setpriority_process(pid: Option<Pid>, priority: i32) -> io::Result<()> {
diff --git a/vendor/rustix/src/process/wait.rs b/vendor/rustix/src/process/wait.rs
index d46c96005..72b37d6d4 100644
--- a/vendor/rustix/src/process/wait.rs
+++ b/vendor/rustix/src/process/wait.rs
@@ -25,7 +25,7 @@ bitflags! {
}
}
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "wasi")))]
bitflags! {
/// Options for modifying the behavior of waitid
#[repr(transparent)]
@@ -124,10 +124,10 @@ impl WaitStatus {
/// The status of a process after calling [`waitid`].
#[derive(Clone, Copy)]
#[repr(transparent)]
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "wasi")))]
pub struct WaitidStatus(pub(crate) backend::c::siginfo_t);
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "wasi")))]
impl WaitidStatus {
/// Returns whether the process is currently stopped.
#[inline]
@@ -243,7 +243,7 @@ impl WaitidStatus {
}
/// The identifier to wait on in a call to [`waitid`].
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "wasi")))]
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum WaitId<'a> {
@@ -317,7 +317,7 @@ pub fn wait(waitopts: WaitOptions) -> io::Result<Option<(Pid, WaitStatus)>> {
/// `waitid(_, _, _, opts)`—Wait for the specified child process to change
/// state.
-#[cfg(not(any(target_os = "wasi", target_os = "redox", target_os = "openbsd")))]
+#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "wasi")))]
#[inline]
pub fn waitid<'a>(
id: impl Into<WaitId<'a>>,
diff --git a/vendor/rustix/src/procfs.rs b/vendor/rustix/src/procfs.rs
index e04793977..010b93126 100644
--- a/vendor/rustix/src/procfs.rs
+++ b/vendor/rustix/src/procfs.rs
@@ -178,7 +178,7 @@ fn check_proc_nonroot(stat: &Stat, proc_stat: Option<&Stat>) -> io::Result<()> {
fn check_procfs(file: BorrowedFd<'_>) -> io::Result<()> {
let statfs = fstatfs(file)?;
let f_type = statfs.f_type;
- if f_type != PROC_SUPER_MAGIC {
+ if f_type != PROC_SUPER_MAGIC.into() {
return Err(io::Errno::NOTSUP);
}
diff --git a/vendor/rustix/src/pty.rs b/vendor/rustix/src/pty.rs
index d7d250250..5040ca2c1 100644
--- a/vendor/rustix/src/pty.rs
+++ b/vendor/rustix/src/pty.rs
@@ -23,7 +23,7 @@ bitflags::bitflags! {
const RDWR = c::O_RDWR as c::c_uint;
/// `O_NOCTTY`
- #[cfg(not(target_os = "redox"))]
+ #[cfg(not(any(target_os = "espidf", target_os = "l4re", target_os = "redox")))]
const NOCTTY = c::O_NOCTTY as c::c_uint;
/// `O_CLOEXEC`
diff --git a/vendor/rustix/src/signal.rs b/vendor/rustix/src/signal.rs
index e1723c990..43236f335 100644
--- a/vendor/rustix/src/signal.rs
+++ b/vendor/rustix/src/signal.rs
@@ -48,11 +48,14 @@ pub enum Signal {
solarish,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
all(
linux_kernel,
any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
),
@@ -106,7 +109,9 @@ pub enum Signal {
linux_kernel,
any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
)
@@ -149,11 +154,14 @@ impl Signal {
solarish,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
all(
linux_kernel,
any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
),
@@ -186,7 +194,9 @@ impl Signal {
linux_kernel,
any(
target_arch = "mips",
+ target_arch = "mips32r6",
target_arch = "mips64",
+ target_arch = "mips64r6",
target_arch = "sparc",
target_arch = "sparc64"
)
@@ -206,7 +216,5 @@ impl Signal {
#[test]
fn test_sizes() {
- use core::mem::size_of;
-
- assert_eq!(size_of::<Signal>(), size_of::<c::c_int>());
+ assert_eq_size!(Signal, c::c_int);
}
diff --git a/vendor/rustix/src/static_assertions.rs b/vendor/rustix/src/static_assertions.rs
new file mode 100644
index 000000000..81824cb1c
--- /dev/null
+++ b/vendor/rustix/src/static_assertions.rs
@@ -0,0 +1,37 @@
+//! Workarounds for Rust 1.63 where some things in the `static_assertions`
+//! crate do things that don't work in const contexts. We want to call them
+//! in const contexts in Rust versions where that's supported so that
+//! problems are caught at compile time, and fall back to dynamic asserts
+//! in Rust 1.63.
+
+#![allow(unused_macros)]
+
+macro_rules! assert_eq_size {
+ ($x:ty, $y:ty) => {
+ assert_eq!(core::mem::size_of::<$x>(), core::mem::size_of::<$y>());
+ };
+}
+
+macro_rules! assert_eq_align {
+ ($x:ty, $y:ty) => {
+ assert_eq!(core::mem::align_of::<$x>(), core::mem::align_of::<$y>());
+ };
+}
+
+macro_rules! const_assert_eq {
+ ($x:expr, $y:expr) => {
+ assert_eq!($x, $y);
+ };
+}
+
+macro_rules! const_assert_ne {
+ ($x:expr, $y:expr) => {
+ assert_ne!($x, $y);
+ };
+}
+
+macro_rules! const_assert {
+ ($x:expr) => {
+ assert!($x);
+ };
+}
diff --git a/vendor/rustix/src/system.rs b/vendor/rustix/src/system.rs
index 1f04c6b20..9346f5560 100644
--- a/vendor/rustix/src/system.rs
+++ b/vendor/rustix/src/system.rs
@@ -8,7 +8,7 @@
use crate::backend;
use crate::ffi::CStr;
-#[cfg(not(target_os = "emscripten"))]
+#[cfg(not(any(target_os = "espidf", target_os = "emscripten")))]
use crate::io;
use core::fmt;
@@ -21,9 +21,23 @@ pub use backend::system::types::Sysinfo;
/// # References
/// - [POSIX]
/// - [Linux]
+/// - [Apple]
+/// - [NetBSD]
+/// - [FreeBSD]
+/// - [OpenBSD]
+/// - [DragonFly BSD]
+/// - [illumos]
+/// - [glibc]
///
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/uname.html
/// [Linux]: https://man7.org/linux/man-pages/man2/uname.2.html
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/uname.3.html
+/// [NetBSD]: https://man.netbsd.org/uname.3
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=uname&sektion=3
+/// [OpenBSD]: https://man.openbsd.org/uname.3
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=uname&section=3
+/// [illumos]: https://illumos.org/man/2/uname
+/// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Platform-Type.html
#[inline]
pub fn uname() -> Uname {
Uname(backend::system::syscalls::uname())
@@ -130,7 +144,12 @@ pub fn sysinfo() -> Sysinfo {
/// - [Linux]
///
/// [Linux]: https://man7.org/linux/man-pages/man2/sethostname.2.html
-#[cfg(not(any(target_os = "emscripten", target_os = "redox", target_os = "wasi")))]
+#[cfg(not(any(
+ target_os = "emscripten",
+ target_os = "espidf",
+ target_os = "redox",
+ target_os = "wasi"
+)))]
#[inline]
pub fn sethostname(name: &[u8]) -> io::Result<()> {
backend::system::syscalls::sethostname(name)
diff --git a/vendor/rustix/src/termios/ioctl.rs b/vendor/rustix/src/termios/ioctl.rs
index 2e8a28ed6..1c60cb9a4 100644
--- a/vendor/rustix/src/termios/ioctl.rs
+++ b/vendor/rustix/src/termios/ioctl.rs
@@ -15,7 +15,7 @@ use crate::{backend, io};
/// [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 = "redox", target_os = "wasi")))]
#[inline]
#[doc(alias = "TIOCEXCL")]
pub fn ioctl_tiocexcl<Fd: AsFd>(fd: Fd) -> io::Result<()> {
@@ -34,7 +34,7 @@ pub fn ioctl_tiocexcl<Fd: AsFd>(fd: Fd) -> io::Result<()> {
/// [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 = "redox", target_os = "wasi")))]
#[inline]
#[doc(alias = "TIOCNXCL")]
pub fn ioctl_tiocnxcl<Fd: AsFd>(fd: Fd) -> io::Result<()> {
diff --git a/vendor/rustix/src/termios/mod.rs b/vendor/rustix/src/termios/mod.rs
index 28abc0488..c61d3f12a 100644
--- a/vendor/rustix/src/termios/mod.rs
+++ b/vendor/rustix/src/termios/mod.rs
@@ -8,20 +8,20 @@
//! [`Termios::set_input_speed`], and it will simply fail if the speed is not
//! supported by the platform.
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "haiku", target_os = "wasi")))]
mod ioctl;
#[cfg(not(target_os = "wasi"))]
mod tc;
#[cfg(not(windows))]
mod tty;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
mod types;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "haiku", target_os = "wasi")))]
pub use ioctl::*;
#[cfg(not(target_os = "wasi"))]
pub use tc::*;
#[cfg(not(windows))]
pub use tty::*;
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
pub use types::*;
diff --git a/vendor/rustix/src/termios/tc.rs b/vendor/rustix/src/termios/tc.rs
index 9deb7798c..cd5902c1a 100644
--- a/vendor/rustix/src/termios/tc.rs
+++ b/vendor/rustix/src/termios/tc.rs
@@ -1,5 +1,6 @@
use crate::fd::AsFd;
use crate::pid::Pid;
+#[cfg(not(target_os = "espidf"))]
use crate::termios::{Action, OptionalActions, QueueSelector, Termios, Winsize};
use crate::{backend, io};
@@ -15,7 +16,7 @@ use crate::{backend, io};
/// [POSIX `tcgetattr`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html
/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html
-#[cfg(not(any(windows, target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "TCGETS")]
#[doc(alias = "TCGETS2")]
@@ -32,7 +33,7 @@ pub fn tcgetattr<Fd: AsFd>(fd: Fd) -> io::Result<Termios> {
/// - [Linux]
///
/// [Linux]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
-#[cfg(not(any(windows, target_os = "wasi")))]
+#[cfg(not(any(windows, target_os = "espidf", target_os = "wasi")))]
#[inline]
#[doc(alias = "TIOCGWINSZ")]
pub fn tcgetwinsize<Fd: AsFd>(fd: Fd) -> io::Result<Winsize> {
@@ -85,6 +86,7 @@ pub fn tcsetpgrp<Fd: AsFd>(fd: Fd, pid: Pid) -> io::Result<()> {
/// [POSIX `tcsetattr`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetattr.html
/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "TCSETS")]
#[doc(alias = "TCSETS2")]
@@ -129,6 +131,7 @@ pub fn tcsendbreak<Fd: AsFd>(fd: Fd) -> io::Result<()> {
/// [POSIX `tcsetattr`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcdrain.html
/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
pub fn tcdrain<Fd: AsFd>(fd: Fd) -> io::Result<()> {
backend::termios::syscalls::tcdrain(fd.as_fd())
@@ -145,6 +148,7 @@ pub fn tcdrain<Fd: AsFd>(fd: Fd) -> io::Result<()> {
/// [POSIX `tcflush`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflush.html
/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "TCFLSH")]
pub fn tcflush<Fd: AsFd>(fd: Fd, queue_selector: QueueSelector) -> io::Result<()> {
@@ -161,6 +165,7 @@ pub fn tcflush<Fd: AsFd>(fd: Fd, queue_selector: QueueSelector) -> io::Result<()
/// [POSIX `tcflow`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflow.html
/// [Linux `ioctl_tty`]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
/// [Linux `termios`]: https://man7.org/linux/man-pages/man3/termios.3.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "TCXONC")]
pub fn tcflow<Fd: AsFd>(fd: Fd, action: Action) -> io::Result<()> {
@@ -190,6 +195,7 @@ pub fn tcgetsid<Fd: AsFd>(fd: Fd) -> io::Result<Pid> {
/// - [Linux]
///
/// [Linux]: https://man7.org/linux/man-pages/man4/tty_ioctl.4.html
+#[cfg(not(target_os = "espidf"))]
#[inline]
#[doc(alias = "TIOCSWINSZ")]
pub fn tcsetwinsize<Fd: AsFd>(fd: Fd, winsize: Winsize) -> io::Result<()> {
diff --git a/vendor/rustix/src/termios/types.rs b/vendor/rustix/src/termios/types.rs
index d978bfcca..8b7d473cf 100644
--- a/vendor/rustix/src/termios/types.rs
+++ b/vendor/rustix/src/termios/types.rs
@@ -31,16 +31,20 @@ pub struct Termios {
#[cfg(any(
linux_like,
target_env = "newlib",
- target_os = "haiku",
target_os = "fuchsia",
+ target_os = "haiku",
target_os = "redox"
))]
pub line_discipline: c::cc_t,
/// How are various special control codes handled?
#[doc(alias = "c_cc")]
+ #[cfg(not(target_os = "haiku"))]
pub special_codes: SpecialCodes,
+ #[cfg(target_os = "nto")]
+ pub(crate) __reserved: [c::c_uint; 3],
+
/// Line discipline.
// On PowerPC, this field comes after `c_cc`.
#[doc(alias = "c_line")]
@@ -51,20 +55,28 @@ pub struct Termios {
///
/// On Linux and BSDs, this is the arbitrary integer speed value. On all
/// other platforms, this is the encoded speed value.
+ #[cfg(not(any(solarish, all(libc, target_env = "newlib"), target_os = "aix")))]
pub(crate) input_speed: c::speed_t,
/// See the `output_speed` and `set_output_seed` functions.
///
/// On Linux and BSDs, this is the integer speed value. On all other
/// platforms, this is the encoded speed value.
+ #[cfg(not(any(solarish, all(libc, target_env = "newlib"), target_os = "aix")))]
pub(crate) output_speed: c::speed_t,
+
+ /// How are various special control codes handled?
+ #[doc(alias = "c_cc")]
+ #[cfg(target_os = "haiku")]
+ pub special_codes: SpecialCodes,
}
impl Termios {
- /// `cfmakeraw(self)`—Set a `Termios` value to the settings for "raw" mode.
+ /// `cfmakeraw(self)`—Set a `Termios` value to the settings for “raw” mode.
///
/// In raw mode, input is available a byte at a time, echoing is disabled,
/// and special terminal input and output codes are disabled.
+ #[cfg(not(target_os = "nto"))]
#[doc(alias = "cfmakeraw")]
#[inline]
pub fn make_raw(&mut self) {
@@ -88,8 +100,20 @@ impl Termios {
self.input_speed as u32
}
+ // On illumos, `input_speed` is not present.
+ #[cfg(any(solarish, all(libc, target_env = "newlib"), target_os = "aix"))]
+ unsafe {
+ speed::decode(c::cfgetispeed(crate::utils::as_ptr(self).cast())).unwrap()
+ }
+
// On other platforms, it's the encoded speed.
- #[cfg(not(any(linux_kernel, bsd)))]
+ #[cfg(not(any(
+ linux_kernel,
+ bsd,
+ solarish,
+ all(libc, target_env = "newlib"),
+ target_os = "aix"
+ )))]
{
speed::decode(self.input_speed).unwrap()
}
@@ -109,8 +133,20 @@ impl Termios {
self.output_speed as u32
}
+ // On illumos, `output_speed` is not present.
+ #[cfg(any(solarish, all(libc, target_env = "newlib"), target_os = "aix"))]
+ unsafe {
+ speed::decode(c::cfgetospeed(crate::utils::as_ptr(self).cast())).unwrap()
+ }
+
// On other platforms, it's the encoded speed.
- #[cfg(not(any(linux_kernel, bsd)))]
+ #[cfg(not(any(
+ linux_kernel,
+ bsd,
+ solarish,
+ all(libc, target_env = "newlib"),
+ target_os = "aix"
+ )))]
{
speed::decode(self.output_speed).unwrap()
}
@@ -123,6 +159,7 @@ impl Termios {
/// encoded constant value. Not all implementations support all integer
/// values; use the constants in the [`speed`] module for likely-supported
/// speeds.
+ #[cfg(not(target_os = "nto"))]
#[doc(alias = "cfsetspeed")]
#[doc(alias = "CBAUD")]
#[doc(alias = "CBAUDEX")]
@@ -180,8 +217,8 @@ impl core::fmt::Debug for Termios {
#[cfg(any(
linux_like,
target_env = "newlib",
- target_os = "haiku",
target_os = "fuchsia",
+ target_os = "haiku",
target_os = "redox"
))]
{
@@ -227,7 +264,7 @@ bitflags! {
const ICRNL = c::ICRNL;
/// `IUCLC`
- #[cfg(any(linux_kernel, solarish, target_os = "haiku"))]
+ #[cfg(any(linux_kernel, solarish, target_os = "aix", target_os = "haiku", target_os = "nto"))]
const IUCLC = c::IUCLC;
/// `IXON`
@@ -246,14 +283,12 @@ bitflags! {
/// `IUTF8`
#[cfg(not(any(
+ freebsdlike,
+ netbsdlike,
solarish,
target_os = "aix",
- target_os = "dragonfly",
target_os = "emscripten",
- target_os = "freebsd",
target_os = "haiku",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
)))]
const IUTF8 = c::IUTF8;
@@ -271,9 +306,8 @@ bitflags! {
/// `OLCUC`
#[cfg(not(any(
apple,
+ freebsdlike,
target_os = "aix",
- target_os = "dragonfly",
- target_os = "freebsd",
target_os = "netbsd",
target_os = "redox",
)))]
@@ -516,7 +550,7 @@ bitflags! {
const CLOCAL = c::CLOCAL;
/// `CRTSCTS`
- #[cfg(not(any(target_os = "aix", target_os = "redox")))]
+ #[cfg(not(any(target_os = "aix", target_os = "nto", target_os = "redox")))]
const CRTSCTS = c::CRTSCTS;
/// `CMSPAR`
@@ -526,6 +560,7 @@ bitflags! {
target_os = "aix",
target_os = "emscripten",
target_os = "haiku",
+ target_os = "nto",
target_os = "redox",
)))]
const CMSPAR = c::CMSPAR;
@@ -533,7 +568,7 @@ bitflags! {
}
bitflags! {
- /// Flags controlling "local" terminal modes.
+ /// Flags controlling “local” terminal modes.
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct LocalModes: c::tcflag_t {
@@ -546,7 +581,7 @@ bitflags! {
const ECHOCTL = c::ECHOCTL;
/// `ECHOPRT`
- #[cfg(not(target_os = "redox"))]
+ #[cfg(not(any(target_os = "nto", target_os = "redox")))]
const ECHOPRT = c::ECHOPRT;
/// `ECHOKE`
@@ -554,15 +589,15 @@ bitflags! {
const ECHOKE = c::ECHOKE;
/// `FLUSHO`
- #[cfg(not(target_os = "redox"))]
+ #[cfg(not(any(target_os = "nto", target_os = "redox")))]
const FLUSHO = c::FLUSHO;
/// `PENDIN`
- #[cfg(not(target_os = "redox"))]
+ #[cfg(not(any(target_os = "nto", target_os = "redox")))]
const PENDIN = c::PENDIN;
/// `EXTPROC`
- #[cfg(not(any(target_os = "aix", target_os = "haiku", target_os = "redox")))]
+ #[cfg(not(any(target_os = "aix", target_os = "haiku", target_os = "nto", target_os = "redox")))]
const EXTPROC = c::EXTPROC;
/// `ISIG`
@@ -760,7 +795,7 @@ pub mod speed {
/// Translate from a `c::speed_t` code to an arbitrary integer speed value
/// `u32`.
#[cfg(not(any(linux_kernel, bsd)))]
- pub(crate) fn decode(encoded_speed: c::speed_t) -> Option<u32> {
+ pub(crate) const fn decode(encoded_speed: c::speed_t) -> Option<u32> {
match encoded_speed {
c::B0 => Some(0),
c::B50 => Some(50),
@@ -782,35 +817,73 @@ pub mod speed {
c::B57600 => Some(57600),
#[cfg(not(target_os = "aix"))]
c::B115200 => Some(115_200),
- #[cfg(not(target_os = "aix"))]
+ #[cfg(not(any(target_os = "aix", target_os = "nto")))]
c::B230400 => Some(230_400),
#[cfg(not(any(
apple,
target_os = "aix",
target_os = "dragonfly",
target_os = "haiku",
+ target_os = "nto",
target_os = "openbsd"
)))]
c::B460800 => Some(460_800),
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
c::B500000 => Some(500_000),
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
c::B576000 => Some(576_000),
#[cfg(not(any(
apple,
target_os = "aix",
target_os = "dragonfly",
target_os = "haiku",
+ target_os = "nto",
target_os = "openbsd"
)))]
c::B921600 => Some(921_600),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
c::B1000000 => Some(1_000_000),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
c::B1152000 => Some(1_152_000),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
c::B1500000 => Some(1_500_000),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
c::B2000000 => Some(2_000_000),
#[cfg(not(any(
target_arch = "sparc",
@@ -818,6 +891,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
c::B2500000 => Some(2_500_000),
@@ -827,6 +901,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
c::B3000000 => Some(3_000_000),
@@ -836,6 +911,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
c::B3500000 => Some(3_500_000),
@@ -845,6 +921,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
c::B4000000 => Some(4_000_000),
@@ -855,7 +932,7 @@ pub mod speed {
/// Translate from an arbitrary `u32` arbitrary integer speed value to a
/// `c::speed_t` code.
#[cfg(not(bsd))]
- pub(crate) fn encode(speed: u32) -> Option<c::speed_t> {
+ pub(crate) const fn encode(speed: u32) -> Option<c::speed_t> {
match speed {
0 => Some(c::B0),
50 => Some(c::B50),
@@ -877,35 +954,73 @@ pub mod speed {
57600 => Some(c::B57600),
#[cfg(not(target_os = "aix"))]
115_200 => Some(c::B115200),
- #[cfg(not(target_os = "aix"))]
+ #[cfg(not(any(target_os = "aix", target_os = "nto")))]
230_400 => Some(c::B230400),
#[cfg(not(any(
apple,
target_os = "aix",
target_os = "dragonfly",
target_os = "haiku",
- target_os = "openbsd"
+ target_os = "nto",
+ target_os = "openbsd",
)))]
460_800 => Some(c::B460800),
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
500_000 => Some(c::B500000),
- #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku")))]
+ #[cfg(not(any(
+ bsd,
+ solarish,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto"
+ )))]
576_000 => Some(c::B576000),
#[cfg(not(any(
apple,
target_os = "aix",
target_os = "dragonfly",
target_os = "haiku",
+ target_os = "nto",
target_os = "openbsd"
)))]
921_600 => Some(c::B921600),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
1_000_000 => Some(c::B1000000),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
1_152_000 => Some(c::B1152000),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
1_500_000 => Some(c::B1500000),
- #[cfg(not(any(bsd, target_os = "aix", target_os = "haiku", target_os = "solaris")))]
+ #[cfg(not(any(
+ bsd,
+ target_os = "aix",
+ target_os = "haiku",
+ target_os = "nto",
+ target_os = "solaris"
+ )))]
2_000_000 => Some(c::B2000000),
#[cfg(not(any(
target_arch = "sparc",
@@ -913,6 +1028,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
2_500_000 => Some(c::B2500000),
@@ -922,6 +1038,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
3_000_000 => Some(c::B3000000),
@@ -931,6 +1048,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
3_500_000 => Some(c::B3500000),
@@ -940,6 +1058,7 @@ pub mod speed {
bsd,
target_os = "aix",
target_os = "haiku",
+ target_os = "nto",
target_os = "solaris",
)))]
4_000_000 => Some(c::B4000000),
@@ -996,14 +1115,11 @@ impl SpecialCodeIndex {
/// `VSWTC`
#[cfg(not(any(
- apple,
+ bsd,
solarish,
target_os = "aix",
- target_os = "dragonfly",
- target_os = "freebsd",
target_os = "haiku",
- target_os = "netbsd",
- target_os = "openbsd",
+ target_os = "nto",
)))]
pub const VSWTC: Self = Self(c::VSWTC as usize);
@@ -1138,31 +1254,51 @@ fn termios_layouts() {
// On everything except PowerPC, `termios` matches `termios2` except for
// the addition of `c_ispeed` and `c_ospeed`.
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
- assert_eq!(
+ const_assert_eq!(
memoffset::offset_of!(Termios, input_speed),
core::mem::size_of::<c::termios>()
);
// On PowerPC, `termios2` is `termios`.
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
- assert_eq!(
- core::mem::size_of::<c::termios2>(),
- core::mem::size_of::<c::termios>()
- );
+ assert_eq_size!(c::termios2, c::termios);
}
#[cfg(not(linux_raw))]
{
+ // On Mips, Sparc, and Android, the libc lacks the ospeed and ispeed
+ // fields.
+ #[cfg(all(
+ not(all(
+ target_env = "gnu",
+ any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6",
+ target_arch = "sparc",
+ target_arch = "sparc64"
+ )
+ )),
+ not(all(libc, target_os = "android"))
+ ))]
+ check_renamed_type!(Termios, termios);
#[cfg(not(all(
- target_env = "gnu",
- any(
- target_arch = "sparc",
- target_arch = "sparc64",
- target_arch = "mips",
- target_arch = "mips64"
- )
+ not(all(
+ target_env = "gnu",
+ any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6",
+ target_arch = "sparc",
+ target_arch = "sparc64"
+ )
+ )),
+ not(all(libc, target_os = "android"))
)))]
- check_renamed_type!(Termios, termios);
+ const_assert!(core::mem::size_of::<Termios>() >= core::mem::size_of::<c::termios>());
+
check_renamed_struct_renamed_field!(Termios, termios, input_modes, c_iflag);
check_renamed_struct_renamed_field!(Termios, termios, output_modes, c_oflag);
check_renamed_struct_renamed_field!(Termios, termios, control_modes, c_cflag);
@@ -1170,8 +1306,8 @@ fn termios_layouts() {
#[cfg(any(
linux_like,
target_env = "newlib",
- target_os = "haiku",
target_os = "fuchsia",
+ target_os = "haiku",
target_os = "redox"
))]
check_renamed_struct_renamed_field!(Termios, termios, line_discipline, c_line);
@@ -1199,11 +1335,16 @@ fn termios_layouts() {
}
#[test]
-#[cfg(not(any(solarish, target_os = "emscripten")))]
+#[cfg(not(any(
+ solarish,
+ target_os = "emscripten",
+ target_os = "haiku",
+ target_os = "redox"
+)))]
fn termios_legacy() {
// Check that our doc aliases above are correct.
- assert_eq!(c::EXTA, c::B19200);
- assert_eq!(c::EXTB, c::B38400);
+ const_assert_eq!(c::EXTA, c::B19200);
+ const_assert_eq!(c::EXTB, c::B38400);
}
#[cfg(bsd)]
@@ -1211,10 +1352,10 @@ fn termios_legacy() {
fn termios_bsd() {
// On BSD platforms we can assume that the `B*` constants have their
// arbitrary integer speed value. Confirm this.
- assert_eq!(c::B0, 0);
- assert_eq!(c::B50, 50);
- assert_eq!(c::B19200, 19200);
- assert_eq!(c::B38400, 38400);
+ const_assert_eq!(c::B0, 0);
+ const_assert_eq!(c::B50, 50);
+ const_assert_eq!(c::B19200, 19200);
+ const_assert_eq!(c::B38400, 38400);
}
#[test]
@@ -1242,26 +1383,36 @@ fn termios_ioctl_contiguity() {
// When using `termios2`, we assume that we can add the optional actions
// value to the ioctl request code. Test this assumption.
- assert_eq!(c::TCSETS2, c::TCSETS2 + 0);
- assert_eq!(c::TCSETSW2, c::TCSETS2 + 1);
- assert_eq!(c::TCSETSF2, c::TCSETS2 + 2);
+ const_assert_eq!(c::TCSETS2, c::TCSETS2 + 0);
+ const_assert_eq!(c::TCSETSW2, c::TCSETS2 + 1);
+ const_assert_eq!(c::TCSETSF2, c::TCSETS2 + 2);
- assert_eq!(c::TCSANOW - c::TCSANOW, 0);
- assert_eq!(c::TCSADRAIN - c::TCSANOW, 1);
- assert_eq!(c::TCSAFLUSH - c::TCSANOW, 2);
+ const_assert_eq!(c::TCSANOW - c::TCSANOW, 0);
+ const_assert_eq!(c::TCSADRAIN - c::TCSANOW, 1);
+ const_assert_eq!(c::TCSAFLUSH - c::TCSANOW, 2);
// MIPS is different here.
- #[cfg(any(target_arch = "mips", target_arch = "mips64"))]
+ #[cfg(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ ))]
{
assert_eq!(i128::from(c::TCSANOW) - i128::from(c::TCSETS), 0);
assert_eq!(i128::from(c::TCSADRAIN) - i128::from(c::TCSETS), 1);
assert_eq!(i128::from(c::TCSAFLUSH) - i128::from(c::TCSETS), 2);
}
- #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
+ #[cfg(not(any(
+ target_arch = "mips",
+ target_arch = "mips32r6",
+ target_arch = "mips64",
+ target_arch = "mips64r6"
+ )))]
{
- assert_eq!(c::TCSANOW, 0);
- assert_eq!(c::TCSADRAIN, 1);
- assert_eq!(c::TCSAFLUSH, 2);
+ const_assert_eq!(c::TCSANOW, 0);
+ const_assert_eq!(c::TCSADRAIN, 1);
+ const_assert_eq!(c::TCSAFLUSH, 2);
}
}
@@ -1269,5 +1420,5 @@ fn termios_ioctl_contiguity() {
#[test]
fn termios_cibaud() {
// Test an assumption.
- assert_eq!(c::CIBAUD, c::CBAUD << c::IBSHIFT);
+ const_assert_eq!(c::CIBAUD, c::CBAUD << c::IBSHIFT);
}
diff --git a/vendor/rustix/src/thread/clock.rs b/vendor/rustix/src/thread/clock.rs
index 7a8c11968..8060c0238 100644
--- a/vendor/rustix/src/thread/clock.rs
+++ b/vendor/rustix/src/thread/clock.rs
@@ -5,7 +5,7 @@ pub use crate::timespec::Timespec;
#[cfg(not(any(
apple,
target_os = "dragonfly",
- target_os = "emscripten",
+ target_os = "espidf",
target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11.
target_os = "openbsd",
target_os = "redox",
@@ -29,6 +29,7 @@ pub use crate::clockid::ClockId;
apple,
target_os = "dragonfly",
target_os = "emscripten",
+ target_os = "espidf",
target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11.
target_os = "haiku",
target_os = "openbsd",
@@ -56,6 +57,7 @@ pub fn clock_nanosleep_relative(id: ClockId, request: &Timespec) -> NanosleepRel
apple,
target_os = "dragonfly",
target_os = "emscripten",
+ target_os = "espidf",
target_os = "freebsd", // FreeBSD 12 has clock_nanosleep, but libc targets FreeBSD 11.
target_os = "haiku",
target_os = "openbsd",
diff --git a/vendor/rustix/src/thread/id.rs b/vendor/rustix/src/thread/id.rs
index 6e193c366..fa3bcfb8d 100644
--- a/vendor/rustix/src/thread/id.rs
+++ b/vendor/rustix/src/thread/id.rs
@@ -21,7 +21,7 @@ pub fn gettid() -> Pid {
///
/// # Warning
///
-/// This is not the setxid you are looking for... POSIX requires xids to be
+/// This is not the setxid you are looking for… POSIX requires xids to be
/// process granular, but on Linux they are per-thread. Thus, this call only
/// changes the xid for the current *thread*, not the entire process even
/// though that is in violation of the POSIX standard.
@@ -46,7 +46,7 @@ pub fn set_thread_uid(uid: Uid) -> io::Result<()> {
///
/// # Warning
///
-/// This is not the setresxid you are looking for... POSIX requires xids to be
+/// This is not the setresxid you are looking for… POSIX requires xids to be
/// process granular, but on Linux they are per-thread. Thus, this call only
/// changes the xid for the current *thread*, not the entire process even
/// though that is in violation of the POSIX standard.
diff --git a/vendor/rustix/src/thread/setns.rs b/vendor/rustix/src/thread/setns.rs
index 2669cc7a7..2dd522a14 100644
--- a/vendor/rustix/src/thread/setns.rs
+++ b/vendor/rustix/src/thread/setns.rs
@@ -65,7 +65,7 @@ bitflags! {
/// `CLONE_FS`.
const FS = CLONE_FS;
/// `CLONE_NEWCGROUP`.
- const NWCGROUP = CLONE_NEWCGROUP;
+ const NEWCGROUP = CLONE_NEWCGROUP;
/// `CLONE_NEWIPC`.
const NEWIPC = CLONE_NEWIPC;
/// `CLONE_NEWNET`.
@@ -78,6 +78,8 @@ bitflags! {
const NEWTIME = CLONE_NEWTIME;
/// `CLONE_NEWUSER`.
const NEWUSER = CLONE_NEWUSER;
+ /// `CLONE_NEWUTS`
+ const NEWUTS = CLONE_NEWUTS;
/// `CLONE_SYSVSEM`.
const SYSVSEM = CLONE_SYSVSEM;
}
diff --git a/vendor/rustix/src/timespec.rs b/vendor/rustix/src/timespec.rs
index 55c4c061b..51c2d2443 100644
--- a/vendor/rustix/src/timespec.rs
+++ b/vendor/rustix/src/timespec.rs
@@ -4,19 +4,11 @@
use crate::backend::c;
/// `struct timespec`
-#[cfg(not(all(
- libc,
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-)))]
+#[cfg(not(fix_y2038))]
pub type Timespec = c::timespec;
/// `struct timespec`
-#[cfg(all(
- libc,
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[derive(Debug, Clone, Copy)]
#[repr(C)]
pub struct Timespec {
@@ -28,18 +20,12 @@ pub struct Timespec {
}
/// A type for the `tv_sec` field of [`Timespec`].
-#[cfg(not(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-)))]
+#[cfg(not(fix_y2038))]
#[allow(deprecated)]
pub type Secs = c::time_t;
/// A type for the `tv_sec` field of [`Timespec`].
-#[cfg(all(
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
pub type Secs = i64;
/// A type for the `tv_nsec` field of [`Timespec`].
@@ -57,11 +43,7 @@ pub type Nsecs = i64;
/// On 32-bit glibc platforms, `timespec` has anonymous padding fields, which
/// Rust doesn't support yet (see `unnamed_fields`), so we define our own
/// struct with explicit padding, with bidirectional `From` impls.
-#[cfg(all(
- libc,
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
#[repr(C)]
#[derive(Debug, Clone)]
pub(crate) struct LibcTimespec {
@@ -76,11 +58,7 @@ pub(crate) struct LibcTimespec {
padding: core::mem::MaybeUninit<u32>,
}
-#[cfg(all(
- libc,
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
impl From<LibcTimespec> for Timespec {
#[inline]
fn from(t: LibcTimespec) -> Self {
@@ -91,11 +69,7 @@ impl From<LibcTimespec> for Timespec {
}
}
-#[cfg(all(
- libc,
- any(target_arch = "arm", target_arch = "mips", target_arch = "x86"),
- target_env = "gnu",
-))]
+#[cfg(fix_y2038)]
impl From<Timespec> for LibcTimespec {
#[inline]
fn from(t: Timespec) -> Self {
@@ -106,3 +80,31 @@ impl From<Timespec> for LibcTimespec {
}
}
}
+
+#[test]
+fn test_sizes() {
+ assert_eq_size!(Secs, u64);
+ const_assert!(core::mem::size_of::<Timespec>() >= core::mem::size_of::<(u64, u32)>());
+ const_assert!(core::mem::size_of::<Nsecs>() >= 4);
+
+ let mut t = Timespec {
+ tv_sec: 0,
+ tv_nsec: 0,
+ };
+
+ // `tv_nsec` needs to be able to hold nanoseconds up to a second.
+ t.tv_nsec = 999_999_999_u32 as _;
+ assert_eq!(t.tv_nsec as u64, 999_999_999_u64);
+
+ // `tv_sec` needs to be able to hold more than 32-bits of seconds.
+ t.tv_sec = 0x1_0000_0000_u64 as _;
+ assert_eq!(t.tv_sec as u64, 0x1_0000_0000_u64);
+}
+
+// Test that our workarounds are needed.
+#[cfg(fix_y2038)]
+#[test]
+#[allow(deprecated)]
+fn test_fix_y2038() {
+ assert_eq_size!(libc::time_t, u32);
+}
diff --git a/vendor/rustix/src/ugid.rs b/vendor/rustix/src/ugid.rs
index fc1082adb..57cc666dd 100644
--- a/vendor/rustix/src/ugid.rs
+++ b/vendor/rustix/src/ugid.rs
@@ -75,18 +75,17 @@ impl Gid {
}
}
-// Return the raw value of the IDs. In case of `None` it returns `u32::MAX`
-// since it has the same bit pattern as `-1` indicating no change to the
-// owner/group ID.
-pub(crate) fn translate_fchown_args(owner: Option<Uid>, group: Option<Gid>) -> (u32, u32) {
+// Return the raw value of the IDs. In case of `None` it returns `!0` since it
+// has the same bit pattern as `-1` indicating no change to the owner/group ID.
+pub(crate) fn translate_fchown_args(owner: Option<Uid>, group: Option<Gid>) -> (RawUid, RawGid) {
let ow = match owner {
Some(o) => o.as_raw(),
- None => u32::MAX,
+ None => !0,
};
let gr = match group {
Some(g) => g.as_raw(),
- None => u32::MAX,
+ None => !0,
};
(ow, gr)
@@ -94,8 +93,6 @@ pub(crate) fn translate_fchown_args(owner: Option<Uid>, group: Option<Gid>) -> (
#[test]
fn test_sizes() {
- use core::mem::size_of;
-
- assert_eq!(size_of::<RawUid>(), size_of::<u32>());
- assert_eq!(size_of::<RawGid>(), size_of::<u32>());
+ assert_eq_size!(RawUid, u32);
+ assert_eq_size!(RawGid, u32);
}
diff --git a/vendor/rustix/src/utils.rs b/vendor/rustix/src/utils.rs
index df2ac315b..c5258394d 100644
--- a/vendor/rustix/src/utils.rs
+++ b/vendor/rustix/src/utils.rs
@@ -18,7 +18,7 @@ pub(crate) fn as_mut_ptr<T>(t: &mut T) -> *mut T {
/// Convert an `Option<&T>` into a possibly-null `*const T`.
#[inline]
-pub(crate) const fn optional_as_ptr<T>(t: Option<&T>) -> *const T {
+pub(crate) const fn option_as_ptr<T>(t: Option<&T>) -> *const T {
match t {
Some(t) => t,
None => null(),
@@ -27,7 +27,7 @@ pub(crate) const fn optional_as_ptr<T>(t: Option<&T>) -> *const T {
/// Convert an `Option<&mut T>` into a possibly-null `*mut T`.
#[inline]
-pub(crate) fn optional_as_mut_ptr<T>(t: Option<&mut T>) -> *mut T {
+pub(crate) fn option_as_mut_ptr<T>(t: Option<&mut T>) -> *mut T {
match t {
Some(t) => t,
None => null_mut(),