Lines Matching defs:CpuSet
166 /// CpuSet represent a bit-mask of CPUs.
173 pub struct CpuSet {
180 impl CpuSet {
181 /// Create a new and empty CpuSet.
182 pub fn new() -> CpuSet {
183 CpuSet {
188 /// Test to see if a CPU is in the CpuSet.
191 if field >= CpuSet::count() {
198 /// Add a CPU to CpuSet.
201 if field >= CpuSet::count() {
211 /// Remove a CPU from CpuSet.
214 if field >= CpuSet::count() {
224 /// Return the maximum number of CPU in CpuSet
235 impl Default for CpuSet {
255 /// use nix::sched::{CpuSet, sched_setaffinity};
258 /// let mut cpu_set = CpuSet::new();
262 pub fn sched_setaffinity(pid: Pid, cpuset: &CpuSet) -> Result<()> {
266 mem::size_of::<CpuSet>() as libc::size_t,
296 pub fn sched_getaffinity(pid: Pid) -> Result<CpuSet> {
297 let mut cpuset = CpuSet::new();
301 mem::size_of::<CpuSet>() as libc::size_t,