From c81e18f5f1220ba8a9d0f03241b271140a3a1066 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 23 Oct 2019 05:00:04 +0300 Subject: [PATCH] Do not try to use sysctl if sys/sysctl.h is not included. GitOrigin-RevId: 49a50aa9c102fd3681963552f5524840e8d222df --- tdutils/td/utils/port/detail/ThreadPthread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdutils/td/utils/port/detail/ThreadPthread.cpp b/tdutils/td/utils/port/detail/ThreadPthread.cpp index 4f869ad0e..ca81e9e90 100644 --- a/tdutils/td/utils/port/detail/ThreadPthread.cpp +++ b/tdutils/td/utils/port/detail/ThreadPthread.cpp @@ -32,7 +32,7 @@ unsigned ThreadPthread::hardware_concurrency() { } #endif -// *BSD +#if TD_FREEBSD || TD_OPENBSD || TD_NETBSD #if defined(HW_AVAILCPU) && defined(CTL_HW) { int mib[2] = {CTL_HW, HW_AVAILCPU}; @@ -53,6 +53,7 @@ unsigned ThreadPthread::hardware_concurrency() { return res; } } +#endif #endif // Just in case