Skip to content

[sanitizer_common] Use HW_NCPUONLINE sysctl on NetBSD in GetNumberOfC… #134704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,11 @@ u32 GetNumberOfCPUs() {
int req[2];
uptr len = sizeof(ncpu);
req[0] = CTL_HW;
# ifdef HW_NCPUONLINE
req[1] = HW_NCPUONLINE;
# else
req[1] = HW_NCPU;
# endif
CHECK_EQ(internal_sysctl(req, 2, &ncpu, &len, NULL, 0), 0);
return ncpu;
# elif SANITIZER_SOLARIS
Expand Down
Loading