Skip to content

Fix FreeBSD build: replace cpuset_getdomain with cpuset_getaffinity for NUMA domain CPU lookup#1003

Merged
rdementi merged 2 commits intopush-2026-02-20from
copilot/sub-pr-1002
Feb 21, 2026
Merged

Fix FreeBSD build: replace cpuset_getdomain with cpuset_getaffinity for NUMA domain CPU lookup#1003
rdementi merged 2 commits intopush-2026-02-20from
copilot/sub-pr-1002

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 21, 2026

cpuset_getdomain expects a domainset_t * as its 5th argument, but the code was passing a cpuset_t *, causing a compilation failure on FreeBSD.

Changes

  • src/cpucounters.cpp: Replace cpuset_getdomain(CPU_LEVEL_WHICH, CPU_WHICH_DOMAIN, ..., &cpuset, DOMAINSET_POLICY_PREFER) with cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_DOMAIN, ..., &cpuset), which correctly accepts cpuset_t * and returns the set of CPUs belonging to a given NUMA domain.
  • Remove unused #include <sys/domainset.h>.
// Before (broken)
cpuset_t cpuset;
cpuset_getdomain(CPU_LEVEL_WHICH, CPU_WHICH_DOMAIN, numa_node_id,
                 sizeof(cpuset), &cpuset, DOMAINSET_POLICY_PREFER);

// After (correct)
cpuset_t cpuset;
cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_DOMAIN, numa_node_id,
                   sizeof(cpuset), &cpuset);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…et_getdomain

Co-authored-by: rdementi <25432609+rdementi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compilation error on FreeBSD Fix FreeBSD build: replace cpuset_getdomain with cpuset_getaffinity for NUMA domain CPU lookup Feb 21, 2026
Copilot AI requested a review from rdementi February 21, 2026 13:52
@rdementi rdementi marked this pull request as ready for review February 21, 2026 13:53
@rdementi rdementi merged commit 11cc76c into push-2026-02-20 Feb 21, 2026
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants