OpenBSD manual page server

Manual Page Search Parameters

CPUSET(3) Library Functions Manual CPUSET(3)

cpuset_create, cpuset_destroy, cpuset_zero, cpuset_set, cpuset_clr, cpuset_isset, cpuset_sizedynamic CPU sets

#include <sched.h>

cpuset_t *
cpuset_create(void);

void
cpuset_destroy(cpuset_t *set);

void
cpuset_zero(cpuset_t *set);

int
cpuset_set(cpuid_t cpu, cpuset_t *set);

int
cpuset_clr(cpuid_t cpu, cpuset_t *set);

int
cpuset_isset(cpuid_t cpu, const cpuset_t *set);

size_t
cpuset_size(const cpuset_t *set);

This section describes the functions used to create, set, use and destroy the dynamic CPU sets.

This API can be used with the POSIX threads, see pthread(3) and affinity(3).

The ID of the primary CPU in the system is 0.

cpuset_create()
Allocates and initializes a clean CPU-set. Returns the pointer to the CPU-set, or NULL on failure.
cpuset_destroy(set)
Destroy the CPU-set specified by set.
cpuset_zero(set)
Makes the CPU-set specified by set clean, that is, memory is initialized to zero bytes, and none of the CPUs set.
cpuset_set(cpu, set)
Sets the CPU specified by cpu in set. Returns zero on success, and -1 if cpu is invalid.
cpuset_clr(cpu, set)
Clears the CPU specified by cpu in the CPU-set set. Returns zero on success, and -1 if cpu is invalid.
cpuset_isset(cpu, set)
Checks if CPU specified by cpu is set in the CPU-set set. Returns the positive number if set, zero if not set, and -1 if cpu is invalid.
cpuset_size(set)
Returns the size in bytes of CPU-set specified by set.

affinity(3), pset(3), sched(3), schedctl(8), kcpuset(9)

The dynamic CPU sets appeared in NetBSD 5.0.

November 2, 2011 NetBSD-7.0.1