Fix CPU count detection in FreeBSD & NetBSD

This commit is contained in:
Feoramund
2024-09-11 07:07:09 -04:00
parent b1db33b519
commit 2938655a3d
3 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -920,7 +920,7 @@ get_page_size :: proc() -> int {
_processor_core_count :: proc() -> int {
count : int = 0
count_size := size_of(count)
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
if _sysctlbyname("hw.ncpu", &count, &count_size, nil, 0) == 0 {
if count > 0 {
return count
}
+1 -1
View File
@@ -978,7 +978,7 @@ get_page_size :: proc() -> int {
_processor_core_count :: proc() -> int {
count : int = 0
count_size := size_of(count)
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
if _sysctlbyname("hw.ncpu", &count, &count_size, nil, 0) == 0 {
if count > 0 {
return count
}