diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/rustix/src/process | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/process')
-rw-r--r-- | vendor/rustix/src/process/mod.rs | 4 | ||||
-rw-r--r-- | vendor/rustix/src/process/sched.rs | 15 | ||||
-rw-r--r-- | vendor/rustix/src/process/wait.rs | 2 |
3 files changed, 18 insertions, 3 deletions
diff --git a/vendor/rustix/src/process/mod.rs b/vendor/rustix/src/process/mod.rs index 195216c3a..5fbc1f3b7 100644 --- a/vendor/rustix/src/process/mod.rs +++ b/vendor/rustix/src/process/mod.rs @@ -32,7 +32,7 @@ mod procctl; target_os = "wasi" )))] mod rlimit; -#[cfg(any(linux_kernel, target_os = "dragonfly", target_os = "fuchsia"))] +#[cfg(any(freebsdlike, linux_kernel, target_os = "fuchsia"))] mod sched; mod sched_yield; #[cfg(not(target_os = "wasi"))] // WASI doesn't have umask. @@ -71,7 +71,7 @@ pub use procctl::*; target_os = "wasi" )))] pub use rlimit::*; -#[cfg(any(linux_kernel, target_os = "dragonfly", target_os = "fuchsia"))] +#[cfg(any(freebsdlike, linux_kernel, target_os = "fuchsia"))] pub use sched::*; pub use sched_yield::sched_yield; #[cfg(not(target_os = "wasi"))] diff --git a/vendor/rustix/src/process/sched.rs b/vendor/rustix/src/process/sched.rs index b7dcd58cc..d6a303af5 100644 --- a/vendor/rustix/src/process/sched.rs +++ b/vendor/rustix/src/process/sched.rs @@ -108,3 +108,18 @@ pub fn sched_getaffinity(pid: Option<Pid>) -> io::Result<CpuSet> { let mut cpuset = CpuSet::new(); backend::process::syscalls::sched_getaffinity(pid, &mut cpuset.cpu_set).and(Ok(cpuset)) } + +/// `sched_getcpu()`—Get the CPU that the current thread is currently on. +/// +/// # References +/// - [Linux] +/// - [DragonFly BSD] +/// +/// [Linux]: https://man7.org/linux/man-pages/man2/sched_getcpu.2.html +/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=sched_getcpu§ion=2 +// FreeBSD added `sched_getcpu` in 13.0. +#[cfg(any(linux_kernel, target_os = "dragonfly"))] +#[inline] +pub fn sched_getcpu() -> usize { + backend::process::syscalls::sched_getcpu() +} diff --git a/vendor/rustix/src/process/wait.rs b/vendor/rustix/src/process/wait.rs index ccb90ae43..4d0e6e25d 100644 --- a/vendor/rustix/src/process/wait.rs +++ b/vendor/rustix/src/process/wait.rs @@ -37,7 +37,7 @@ bitflags! { /// Return immediately if no child has exited. const NOHANG = bitcast!(backend::process::wait::WNOHANG); /// Return if a stopped child has been resumed by delivery of - /// [`Signal::Cont`] + /// [`Signal::Cont`]. const CONTINUED = bitcast!(backend::process::wait::WCONTINUED); /// Wait for processed that have exited. const EXITED = bitcast!(backend::process::wait::WEXITED); |