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

Function test_core_scheduling_cookie

tests/thread/prctl.rs:128–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126#[cfg(feature = "system")]
127#[test]
128fn test_core_scheduling_cookie() {
129 if !linux_kernel_config_item_is_enabled("CONFIG_SCHED_CORE").unwrap_or(false) {
130 eprintln!(
131 "test_core_scheduling_cookie: Test skipped due to missing kernel feature: \
132 CONFIG_SCHED_CORE."
133 );
134 return;
135 }
136
137 match core_scheduling_cookie(rustix::thread::gettid(), CoreSchedulingScope::Thread) {
138 Ok(cookie) => println!("core_scheduling_cookie = {:?}", cookie),
139
140 Err(r) => {
141 let errno = r.raw_os_error();
142 assert!(errno == libc::ENODEV || errno == libc::EINVAL);
143 eprintln!("test_core_scheduling_cookie: Test unsupported: {}", r);
144 }
145 }
146}
147
148//
149// Helper functions.

Callers

nothing calls this directly

Calls 4

core_scheduling_cookieFunction · 0.85
gettidFunction · 0.50
raw_os_errorMethod · 0.45

Tested by

no test coverage detected