summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/libc/process
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/rustix/src/backend/libc/process
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/backend/libc/process')
-rw-r--r--vendor/rustix/src/backend/libc/process/syscalls.rs33
-rw-r--r--vendor/rustix/src/backend/libc/process/types.rs5
2 files changed, 14 insertions, 24 deletions
diff --git a/vendor/rustix/src/backend/libc/process/syscalls.rs b/vendor/rustix/src/backend/libc/process/syscalls.rs
index a84385cf1..dd71801d5 100644
--- a/vendor/rustix/src/backend/libc/process/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/process/syscalls.rs
@@ -3,9 +3,11 @@
#[cfg(any(linux_kernel, target_os = "dragonfly", target_os = "fuchsia"))]
use super::types::RawCpuSet;
use crate::backend::c;
+#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
+use crate::backend::conv::borrowed_fd;
#[cfg(feature = "fs")]
use crate::backend::conv::c_str;
-#[cfg(all(feature = "fs", not(target_os = "wasi")))]
+#[cfg(all(feature = "alloc", feature = "fs", not(target_os = "wasi")))]
use crate::backend::conv::ret_discarded_char_ptr;
#[cfg(not(any(
target_os = "espidf",
@@ -14,12 +16,14 @@ use crate::backend::conv::ret_discarded_char_ptr;
target_os = "wasi"
)))]
use crate::backend::conv::ret_infallible;
+#[cfg(not(target_os = "wasi"))]
+use crate::backend::conv::ret_pid_t;
#[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(all(feature = "alloc", not(target_os = "wasi")))]
+use crate::backend::conv::ret_usize;
use crate::backend::conv::{ret, ret_c_int};
-#[cfg(not(target_os = "wasi"))]
+#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
use crate::fd::BorrowedFd;
#[cfg(target_os = "linux")]
use crate::fd::{AsRawFd, OwnedFd, RawFd};
@@ -28,12 +32,14 @@ use crate::ffi::CStr;
#[cfg(feature = "fs")]
use crate::fs::Mode;
use crate::io;
+#[cfg(all(feature = "alloc", not(target_os = "wasi")))]
+use crate::process::Gid;
+#[cfg(not(target_os = "wasi"))]
+use crate::process::Pid;
#[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};
#[cfg(not(any(target_os = "espidf", target_os = "wasi")))]
use crate::process::{RawPid, Signal, WaitOptions, WaitStatus};
#[cfg(not(any(
@@ -73,7 +79,7 @@ pub(crate) fn chroot(path: &CStr) -> io::Result<()> {
unsafe { ret(c::chroot(c_str(path))) }
}
-#[cfg(feature = "fs")]
+#[cfg(all(feature = "alloc", feature = "fs"))]
#[cfg(not(target_os = "wasi"))]
pub(crate) fn getcwd(buf: &mut [MaybeUninit<u8>]) -> io::Result<()> {
unsafe { ret_discarded_char_ptr(c::getcwd(buf.as_mut_ptr().cast(), buf.len())) }
@@ -612,20 +618,9 @@ pub(crate) fn pidfd_getfd(
}
}
-#[cfg(not(target_os = "wasi"))]
+#[cfg(all(feature = "alloc", not(target_os = "wasi")))]
pub(crate) fn getgroups(buf: &mut [Gid]) -> io::Result<usize> {
let len = buf.len().try_into().map_err(|_| io::Errno::NOMEM)?;
unsafe { ret_usize(c::getgroups(len, buf.as_mut_ptr().cast()) as isize) }
}
-
-#[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 9c543acd0..26bae3498 100644
--- a/vendor/rustix/src/backend/libc/process/types.rs
+++ b/vendor/rustix/src/backend/libc/process/types.rs
@@ -141,11 +141,6 @@ impl Resource {
pub const Rss: Self = Self::As;
}
-pub const EXIT_SUCCESS: c::c_int = c::EXIT_SUCCESS;
-pub const EXIT_FAILURE: c::c_int = c::EXIT_FAILURE;
-#[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.
#[cfg(linux_kernel)]
pub type RawCpuid = u32;