aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-09-16 11:23:42 +0200
committerAnton Khirnov <anton@khirnov.net>2022-09-16 11:23:42 +0200
commitb43cc61bc85781e384eb183c3818b08421f0b84f (patch)
tree665182e4e32cd14bb640325f5f216e327b3f9e45
parent27efabfe36b54f11cdcc7ccbc59d47fa182f0061 (diff)
cpu: remove support for deprecated sysctl.h header
It is not present with new glibc versions.
-rw-r--r--config.asm1
-rw-r--r--config.h1
-rw-r--r--cpu.c13
3 files changed, 0 insertions, 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 <windows.h>
#endif
-#if HAVE_SYSCTL
-#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
#if HAVE_SYSCONF
#include <unistd.h>
#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)