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

Function core_scheduling_cookie

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

Source from the content-addressed store, hash-verified

1050/// [`prctl(PR_SCHED_CORE,PR_SCHED_CORE_GET,…)`]: https://www.kernel.org/doc/html/v6.13/admin-guide/hw-vuln/core-scheduling.html
1051#[inline]
1052pub fn core_scheduling_cookie(pid: Pid, scope: CoreSchedulingScope) -> io::Result<u64> {
1053 let mut value: MaybeUninit<u64> = MaybeUninit::uninit();
1054 unsafe {
1055 syscalls::prctl(
1056 PR_SCHED_CORE,
1057 PR_SCHED_CORE_GET as *mut _,
1058 pid.as_raw_nonzero().get() as usize as *mut _,
1059 scope as usize as *mut _,
1060 value.as_mut_ptr().cast(),
1061 )?;
1062 Ok(value.assume_init())
1063 }
1064}
1065
1066const PR_SCHED_CORE_CREATE: usize = 1;
1067

Callers 1

Calls 5

assume_initMethod · 0.80
prctlFunction · 0.50
getMethod · 0.45
as_raw_nonzeroMethod · 0.45
as_mut_ptrMethod · 0.45

Tested by 1