Struct scheduler::CpuSet [] [src]

pub struct CpuSet { /* fields omitted */ }

Struct representing a bitmask to be used with the affinity functions. Meant to represent the CPU_* macros from sched.h

Methods

impl CpuSet
[src]

Create a new CpuSet with room for num_cpus CPUs, no cpu will be active. Equivalent of CPU_ALLOC

Create a new CpuSet from a given mask. For example a u64 or a u8.

Create a new CpuSet that with one CPU set as active. Shorthand for using new and set

Activate a given cpu on this CpuSet. If the given cpu does not fit in the current CpuSet, it will be expanded to fit. Equivalent of CPU_SET

Clear a given cpu on this CpuSet. If the given cpu does not fit within the current CpuSet nothing will happen. Equivalent of CPU_CLR.

Get if a given CPU is active in this CpuSet. If cpu does not fit in this CpuSet false will be returned. Equivalent of CPU_ISSET.

Get the number of bytes in the mask. Produces the same results as CPU_ALLOC_SIZE.

Get the raw pointer to the bitmask Any modification of the CpuSet after this call might invalidate the pointer.

Get a mutable raw pointer to the bitmask. Any modification of the CpuSet after this call might invalidate the pointer.

Represent this CpuSet as a u64. Will return an Err if the CpuSet is too large to be written to a u64

Sets the affinity described by this CpuSet to a given pid.

Fetch the affinity for a given pid as a CpuSet.