CPUSET(3)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’… 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 crumbs
  • 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. so like… know your limits 🫠
  • CPUSET_PARSE_GETDOMAIN β€” the cpuset_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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms