devela::_dep::nc::call

Function getcpu

pub unsafe fn getcpu(
    cpu: &mut u32,
    node: &mut u32,
    cache: &mut getcpu_cache_t,
) -> Result<(), i32> 
Available on crate feature dep_nc only.
Expand description

Determine CPU and NUMA node on which the calling thread is running.

§Examples

let mut cpu = 0;
let mut node = 0;
let mut cache = nc::getcpu_cache_t::default();
let ret = unsafe { nc::getcpu(&mut cpu, &mut node, &mut cache) };
assert!(ret.is_ok());