From b43cc61bc85781e384eb183c3818b08421f0b84f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 16 Sep 2022 11:23:42 +0200 Subject: cpu: remove support for deprecated sysctl.h header It is not present with new glibc versions. --- config.asm | 1 - config.h | 1 - cpu.c | 13 ------------- 3 files changed, 15 deletions(-) diff --git a/config.asm b/config.asm index 0ee0ca2..828455b 100644 --- a/config.asm +++ b/config.asm @@ -230,7 +230,6 @@ %define HAVE_STRERROR_R 1 %define HAVE_STRPTIME 1 %define HAVE_SYSCONF 1 -%define HAVE_SYSCTL 1 %define HAVE_USLEEP 1 %define HAVE_VIRTUALALLOC 0 %define HAVE_PTHREADS 1 diff --git a/config.h b/config.h index ffd98d8..da1df56 100644 --- a/config.h +++ b/config.h @@ -6,7 +6,6 @@ #define ARCH_X86_64 1 #define ARCH_X86 1 #define HAVE_SCHED_GETAFFINITY 1 -#define HAVE_SYSCTL 1 #define HAVE_OPENCL 0 #define TD_VERIFY 0 #define TD_POLAR 1 diff --git a/cpu.c b/cpu.c index 173a025..843878a 100644 --- a/cpu.c +++ b/cpu.c @@ -22,13 +22,6 @@ #if HAVE_GETPROCESSAFFINITYMASK #include #endif -#if HAVE_SYSCTL -#if HAVE_SYS_PARAM_H -#include -#endif -#include -#include -#endif #if HAVE_SYSCONF #include #endif @@ -204,12 +197,6 @@ unsigned int tdi_cpu_count(void) DWORD_PTR proc_aff, sys_aff; if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff)) nb_cpus = av_popcount64(proc_aff); -#elif HAVE_SYSCTL && defined(HW_NCPU) - int mib[2] = { CTL_HW, HW_NCPU }; - size_t len = sizeof(nb_cpus); - - if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1) - nb_cpus = 0; #elif HAVE_SYSCONF && defined(_SC_NPROC_ONLN) nb_cpus = sysconf(_SC_NPROC_ONLN); #elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN) -- cgit v1.2.3