From 63e17aaa5b956826b6730888a50e552272ed3390 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Fri, 21 Feb 2025 13:47:58 +0100 Subject: [PATCH] Remove IOKit / IOMainPort / IOMMasterPort logic Supersedes 2e62fae from PR #1612 Closes #1612 --- configure.ac | 2 -- darwin/Platform.c | 14 -------------- 2 files changed, 16 deletions(-) diff --git a/configure.ac b/configure.ac index bc98008b0..bada27130 100644 --- a/configure.ac +++ b/configure.ac @@ -376,8 +376,6 @@ AC_CHECK_FUNCS([ \ if test "$my_htop_platform" = darwin; then AC_CHECK_FUNCS([mach_timebase_info]) - AC_CHECK_DECLS([IOMainPort], [], [], [[#include ]]) - AC_CHECK_DECLS([IOMasterPort], [], [], [[#include ]]) AC_CHECK_FUNCS([host_statistics64], [ AC_CHECK_TYPES([struct vm_statistics64], [], [], [[#include ]]) diff --git a/darwin/Platform.c b/darwin/Platform.c index ec8acb2ff..78caedf30 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -152,7 +152,6 @@ static double Platform_nanosecondsPerMachTick = 1.0; static double Platform_nanosecondsPerSchedulerTick = -1; -static bool iokit_available = false; static mach_port_t iokit_port; // the mach port used to initiate communication with IOKit bool Platform_init(void) { @@ -169,17 +168,6 @@ bool Platform_init(void) { const double nanos_per_sec = 1e9; Platform_nanosecondsPerSchedulerTick = nanos_per_sec / scheduler_ticks_per_sec; - // Since macOS 12.0, IOMasterPort is deprecated, and one should use IOMainPort instead - #if defined(HAVE_DECL_IOMAINPORT) && HAVE_DECL_IOMAINPORT - if (!IOMainPort(bootstrap_port, &iokit_port)) { - iokit_available = true; - } - #elif defined(HAVE_DECL_IOMASTERPORT) && HAVE_DECL_IOMASTERPORT - if (!IOMasterPort(bootstrap_port, &iokit_port)) { - iokit_available = true; - } - #endif - return true; } @@ -410,8 +398,6 @@ void Platform_getFileDescriptors(double* used, double* max) { } bool Platform_getDiskIO(DiskIOData* data) { - if (!iokit_available) - return false; io_iterator_t drive_list;