From 2159f73eaa3459baeafc5f86a9b338c4573ccba5 Mon Sep 17 00:00:00 2001 From: Robert Kausch Date: Tue, 29 Oct 2019 20:38:55 +0100 Subject: [PATCH] Add support for get_total_cpus on Haiku. --- libcpuid/cpuid_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libcpuid/cpuid_main.c b/libcpuid/cpuid_main.c index 5f95e89..d51e096 100644 --- a/libcpuid/cpuid_main.c +++ b/libcpuid/cpuid_main.c @@ -114,6 +114,17 @@ static int get_total_cpus(void) #define GET_TOTAL_CPUS_DEFINED #endif +#ifdef __HAIKU__ +#include +static int get_total_cpus(void) +{ + system_info info; + get_system_info(&info); + return info.cpu_count; +} +#define GET_TOTAL_CPUS_DEFINED +#endif + #if defined linux || defined __linux__ || defined __sun #include #include