CPU_ZERO - Linux
Overview
CPU_ZERO initializes a cpu_set_t
structure to an empty set, in which no CPUs are set.
Syntax
void CPU_ZERO(cpu_set_t *set);
Options/Flags
None.
Examples
Example 1:
# Initialize a cpu_set_t variable to an empty set
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
Common Issues
- None.
Integration
CPU_ZERO is commonly used in conjunction with other functions such as CPU_SET
and CPU_ISSET
to manipulate CPU sets.
Related Commands
CPU_ISSET
: Checks if a CPU is set in a CPU set.CPU_SET
: Sets a CPU in a CPU set.sched_setaffinity
: Configures the CPU affinity for a thread.