cpuset(3)

cpuset3

Utility functions for cpuset(2) handling

Usage

#include <sys/cpuset.h>

#include <libutil.h>

int

cpuset_parselist(const char *cpu_list, cpuset_t *mask);

int

domainset_parselist(const char *domain_policy, domainset_t *domain_mask, int *policyp);

Library

System Utilities Library (libutil, -lutil)

Overview

The cpuset_parselist() function parses a cpu-list filling the mask.

The cpu-list may include numbers separated by '-' for ranges and commas separating individual numbers. A special list of “all” may be specified in which case the list includes all CPUs from the root set.

The domainset_parselist() function parses a domainset(9) memory domain allocation policy specified by domain_policy filling the domain_mask and the policyp. A valid domain_policy is formatted as policy:domain-list. See the -n flag in cpuset(1) for a list of valid domain policies.

Return values

Return values can be the following

CPUSET_PARSE_OK

The parsing was successful

CPUSET_PARSE_ERROR

The cpu-list or domain-policy format is invalid

CPUSET_PARSE_GETAFFINITY

The cpuset_getaffinity(2) call has failed

CPUSET_PARSE_INVALID_CPU

The number of supported CPUs or NUMA domains has been exceeded. The maximum number being CPU_SETSIZE and DOMAINSET_SETSIZE respectively.

CPUSET_PARSE_GETDOMAIN

The cpuset_getdomain(2) call has failed

Releases

9 releases since FreeBSD 14.0-RELEASE; the text changed 1 time.

  1. 14.0–14.5
  2. 15.0–16.0

Authors

Jeffrey Roberson ⟨[email protected]⟩

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.