Skip to content
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

Use HW_NCPUONLINE on OpenBSD / NetBSD #3813

Merged
merged 1 commit into from
Dec 17, 2024
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: 3 additions & 1 deletion codec/common/src/WelsThreadLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
#endif
#ifdef __APPLE__
#define HW_NCPU_NAME "hw.logicalcpu"
#elif defined(HW_NCPUONLINE)
#define HW_NCPU_NAME "hw.ncpuonline"
#else
#define HW_NCPU_NAME "hw.ncpu"
#endif
Expand Down Expand Up @@ -522,7 +524,7 @@ WELS_THREAD_ERROR_CODE WelsQueryLogicalProcessInfo (WelsLogicalProcessInfo* p
size_t len = sizeof (pInfo->ProcessorCount);

#if defined(__OpenBSD__)
int scname[] = { CTL_HW, HW_NCPU };
int scname[] = { CTL_HW, HW_NCPUONLINE };
if (sysctl (scname, 2, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
#else
if (sysctlbyname (HW_NCPU_NAME, &pInfo->ProcessorCount, &len, NULL, 0) == -1)
Expand Down
Loading