CPUSET(3)
π CPUSET(3) β the cpuset_parselist & domainset_parselist manual, but make it make sense π
okay bestie, so this is a page out of the Library Functions Manual β it lives in the libutil corner of the world, and it's here to teach you about cpuset_parselist, domainset_parselist β utility functions for cpuset(2) handling β¨
π NAME π
cpuset_parselist, domainset_parselist β utility functions for cpuset(2) handling. that's the whole vibe, no cap.
π LIBRARY π
System Utilities Library β it's libutil, and you link it with -lutil. slay π«Ά
π¦ SYNOPSIS π¦
#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);
πΈ DESCRIPTION πΈ
okay so first up: cpuset_parselist() β it parses a cpu-list, filling the mask. that's it, that's the job π
and what even is a cpu-list? bestie it's literally numbers, with - for ranges and commas separating the individual numbers, iykyk. and there's this special little icon list called βallβ β if you specify that, the list includes all CPUs from the root set. main character energy fr fr π
then we've got domainset_parselist() β this one parses a domainset(9) memory domain allocation policy specified by domain_policy, filling the domain_mask and the policyp. two for the price of one, we love a multitasker π
a valid domain_policy is formatted as policy:domain-list β periodt. and if you wanna know which domain policies are even valid? go peek at the -n flag in cpuset(1), it's giving the whole list β¨
β RETURN VALUES β
the return values can be, like, the following:
CPUSET_PARSE_OKβ the parsing was successful π ate, no crumbsCPUSET_PARSE_ERRORβ the cpu-list or domain-policy format is invalid πCPUSET_PARSE_GETAFFINITYβ thecpuset_getaffinity(2)call has failed πCPUSET_PARSE_INVALID_CPUβ the number of supported CPUs or NUMA domains has been exceeded. the maximum number beingCPU_SETSIZEandDOMAINSET_SETSIZErespectively. so likeβ¦ know your limits π«CPUSET_PARSE_GETDOMAINβ thecpuset_getdomain(2)call has failed π
no cap: those last three are failures, not vibes. handle them, bestie.
π SEE ALSO π
cpuset(1), cpuset(2), numa(4), cpuset(9), domainset(9) β go read your siblings, they're iconic too π¦
π AUTHORS π
Jeffrey Roberson <jeff@FreeBSD.org> β legend behaviour, we stan π«Ά
and that's the page!! this lil doc came to you from Debian, dated June 24, 2025 β mwah, go parse some lists responsibly, bestie ππβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2017 Baptiste Daroussin <bapt@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms