Skip to content

Commit

Permalink
Use HW_NCPUONLINE on OpenBSD
Browse files Browse the repository at this point in the history
HW_NCPUONLINE is the proper sysctl to use for the logical processor
count.
  • Loading branch information
brad0 committed Nov 24, 2024
1 parent 6746bc4 commit 32e5906
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codec/common/src/WelsThreadLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,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

0 comments on commit 32e5906

Please sign in to comment.