diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index 486aa0b..7cce39e 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -560,6 +560,16 @@ public @property uint logicalProcessorCount() size_t count_len = count.sizeof; sysctlbyname("hw.logicalcpu", &count, &count_len, null, 0); return cast(uint)count_len; + } else version (FreeBSD) { + int count; + size_t count_len = count.sizeof; + sysctlbyname("hw.logicalcpu", &count, &count_len, null, 0); + return cast(uint)count_len; + } else version (NetBSD) { + int count; + size_t count_len = count.sizeof; + sysctlbyname("hw.logicalcpu", &count, &count_len, null, 0); + return cast(uint)count_len; } else version (Windows) { import core.sys.windows.windows; SYSTEM_INFO sysinfo; @@ -568,6 +578,9 @@ public @property uint logicalProcessorCount() } else static assert(false, "Unsupported OS!"); } version (OSX) private extern(C) int sysctlbyname(const(char)* name, void* oldp, size_t* oldlen, void* newp, size_t newlen); +version (FreeBSD) private extern(C) int sysctlbyname(const(char)* name, void* oldp, size_t* oldlen, void* newp, size_t newlen); +version (NetBSD) private extern(C) int sysctlbyname(const(char)* name, void* oldp, size_t* oldlen, void* newp, size_t newlen); +version (linux) static if (__VERSION__ <= 2066) private extern(C) int get_nprocs(); /** Suspends the execution of the calling task to let other tasks and events be