MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / push_core_scheduling_cookie

Function push_core_scheduling_cookie

src/thread/prctl.rs:1097–1108  ·  view source on GitHub ↗
(pid: Pid, scope: CoreSchedulingScope)

Source from the content-addressed store, hash-verified

1095/// [`prctl(PR_SCHED_CORE,PR_SCHED_CORE_SHARE_TO,…)`]: https://www.kernel.org/doc/html/v6.13/admin-guide/hw-vuln/core-scheduling.html
1096#[inline]
1097pub fn push_core_scheduling_cookie(pid: Pid, scope: CoreSchedulingScope) -> io::Result<()> {
1098 unsafe {
1099 syscalls::prctl(
1100 PR_SCHED_CORE,
1101 PR_SCHED_CORE_SHARE_TO as *mut _,
1102 pid.as_raw_nonzero().get() as usize as *mut _,
1103 scope as usize as *mut _,
1104 ptr::null_mut(),
1105 )
1106 .map(|_r| ())
1107 }
1108}
1109
1110const PR_SCHED_CORE_SHARE_FROM: usize = 3;
1111

Callers

nothing calls this directly

Calls 3

prctlFunction · 0.50
getMethod · 0.45
as_raw_nonzeroMethod · 0.45

Tested by

no test coverage detected