mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-18 08:41:31 -07:00
Fix CPU count detection in FreeBSD & NetBSD
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user