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

Function create_core_scheduling_cookie

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

Source from the content-addressed store, hash-verified

1073/// [`prctl(PR_SCHED_CORE,PR_SCHED_CORE_CREATE,…)`]: https://www.kernel.org/doc/html/v6.13/admin-guide/hw-vuln/core-scheduling.html
1074#[inline]
1075pub fn create_core_scheduling_cookie(pid: Pid, scope: CoreSchedulingScope) -> io::Result<()> {
1076 unsafe {
1077 syscalls::prctl(
1078 PR_SCHED_CORE,
1079 PR_SCHED_CORE_CREATE as *mut _,
1080 pid.as_raw_nonzero().get() as usize as *mut _,
1081 scope as usize as *mut _,
1082 ptr::null_mut(),
1083 )
1084 .map(|_r| ())
1085 }
1086}
1087
1088const PR_SCHED_CORE_SHARE_TO: usize = 2;
1089

Callers

nothing calls this directly

Calls 3

prctlFunction · 0.50
getMethod · 0.45
as_raw_nonzeroMethod · 0.45

Tested by

no test coverage detected