summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/linux_raw
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /vendor/rustix/src/backend/linux_raw
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/backend/linux_raw')
-rw-r--r--vendor/rustix/src/backend/linux_raw/mod.rs1
-rw-r--r--vendor/rustix/src/backend/linux_raw/param/auxv.rs7
-rw-r--r--vendor/rustix/src/backend/linux_raw/termios/types.rs8
-rw-r--r--vendor/rustix/src/backend/linux_raw/thread/syscalls.rs6
-rw-r--r--vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs2
5 files changed, 18 insertions, 6 deletions
diff --git a/vendor/rustix/src/backend/linux_raw/mod.rs b/vendor/rustix/src/backend/linux_raw/mod.rs
index 231dc37b6..e7e073e32 100644
--- a/vendor/rustix/src/backend/linux_raw/mod.rs
+++ b/vendor/rustix/src/backend/linux_raw/mod.rs
@@ -28,7 +28,6 @@ mod vdso_wrappers;
pub(crate) mod fs;
pub(crate) mod io;
#[cfg(feature = "io_uring")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "io_uring")))]
pub(crate) mod io_uring;
#[cfg(feature = "mm")]
pub(crate) mod mm;
diff --git a/vendor/rustix/src/backend/linux_raw/param/auxv.rs b/vendor/rustix/src/backend/linux_raw/param/auxv.rs
index 20a3d5da6..acdd9d0e7 100644
--- a/vendor/rustix/src/backend/linux_raw/param/auxv.rs
+++ b/vendor/rustix/src/backend/linux_raw/param/auxv.rs
@@ -10,6 +10,7 @@ use super::super::elf::*;
use crate::fd::OwnedFd;
#[cfg(feature = "param")]
use crate::ffi::CStr;
+#[cfg(not(target_vendor = "mustang"))]
use crate::fs::{Mode, OFlags};
use crate::utils::{as_ptr, check_raw_pointer};
use alloc::vec::Vec;
@@ -130,6 +131,7 @@ static PHNUM: AtomicUsize = AtomicUsize::new(0);
static EXECFN: AtomicPtr<c::c_char> = AtomicPtr::new(null_mut());
/// On non-Mustang platforms, we read the aux vector from /proc/self/auxv.
+#[cfg(not(target_vendor = "mustang"))]
fn init_from_proc_self_auxv() {
// Open "/proc/self/auxv", either because we trust "/proc", or because
// we're running inside QEMU and `proc_self_auxv`'s extra checking foils
@@ -146,6 +148,11 @@ fn init_from_proc_self_auxv() {
let _ = init_from_auxv_file(file);
}
+#[cfg(target_vendor = "mustang")]
+fn init_from_proc_self_auxv() {
+ panic!("mustang should have initialized the auxv values");
+}
+
/// Process auxv entries from the open file `auxv`.
fn init_from_auxv_file(auxv: OwnedFd) -> Option<()> {
let mut buffer = Vec::<u8>::with_capacity(512);
diff --git a/vendor/rustix/src/backend/linux_raw/termios/types.rs b/vendor/rustix/src/backend/linux_raw/termios/types.rs
index 88db4e1c9..a44f1eda5 100644
--- a/vendor/rustix/src/backend/linux_raw/termios/types.rs
+++ b/vendor/rustix/src/backend/linux_raw/termios/types.rs
@@ -338,19 +338,19 @@ pub const B1500000: Speed = linux_raw_sys::general::B1500000;
pub const B2000000: Speed = linux_raw_sys::general::B2000000;
/// `B2500000`
-#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))]
+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
pub const B2500000: Speed = linux_raw_sys::general::B2500000;
/// `B3000000`
-#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))]
+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
pub const B3000000: Speed = linux_raw_sys::general::B3000000;
/// `B3500000`
-#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))]
+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
pub const B3500000: Speed = linux_raw_sys::general::B3500000;
/// `B4000000`
-#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64",)))]
+#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))]
pub const B4000000: Speed = linux_raw_sys::general::B4000000;
/// `CSIZE`
diff --git a/vendor/rustix/src/backend/linux_raw/thread/syscalls.rs b/vendor/rustix/src/backend/linux_raw/thread/syscalls.rs
index 99c632e7e..2ec3e43e8 100644
--- a/vendor/rustix/src/backend/linux_raw/thread/syscalls.rs
+++ b/vendor/rustix/src/backend/linux_raw/thread/syscalls.rs
@@ -288,3 +288,9 @@ unsafe fn futex_old(
pub(crate) fn setns(fd: BorrowedFd, nstype: c::c_int) -> io::Result<c::c_int> {
unsafe { ret_c_int(syscall_readonly!(__NR_setns, fd, c_int(nstype))) }
}
+
+#[cfg(any(target_os = "android", target_os = "linux"))]
+#[inline]
+pub(crate) fn unshare(flags: crate::thread::UnshareFlags) -> io::Result<()> {
+ unsafe { ret(syscall_readonly!(__NR_unshare, c_uint(flags.bits()))) }
+}
diff --git a/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs b/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
index 487835314..aaa000622 100644
--- a/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
+++ b/vendor/rustix/src/backend/linux_raw/vdso_wrappers.rs
@@ -364,7 +364,7 @@ fn init() {
// On all 64-bit platforms, the 64-bit `clock_gettime` symbols are
// always available.
- #[cfg(any(target_pointer_width = "64"))]
+ #[cfg(target_pointer_width = "64")]
let ok = true;
// On some 32-bit platforms, the 64-bit `clock_gettime` symbols are not