nc/platform/linux-types/linux/
getcpu.rs

1// Copyright (c) 2020 Xu Shaohua <shaohua@biofan.org>. All rights reserved.
2// Use of this source is governed by Apache-2.0 License that can be found
3// in the LICENSE file.
4
5//! From `include/linux/getcpu.h`
6
7#![allow(clippy::module_name_repetitions)]
8
9use core::mem::size_of;
10
11pub const LINUX_GETCPU_H: i32 = 1;
12
13/// Cache for `getcpu()` to speed it up. Results might be a short time
14/// out of date, but will be faster.
15///
16/// User programs should not refer to the contents of this structure.
17/// I repeat they should not refer to it. If they do they will break
18/// in future kernels.
19///
20/// It is only a private cache for `vgetcpu()`. It will change in future kernels.
21/// The user program must store this information per thread (__thread)
22/// If you want 100% accurate information pass NULL instead.
23#[repr(C)]
24#[derive(Debug, Default)]
25pub struct getcpu_cache_t {
26    pub blob: [usize; 128 / size_of::<usize>()],
27}