Skip to content

Commit

Permalink
Remove IOKit / IOMainPort / IOMMasterPort logic
Browse files Browse the repository at this point in the history
Supersedes 2e62fae from PR #1612
Closes #1612
  • Loading branch information
Daniel Lange authored and Daniel Lange committed Feb 21, 2025
1 parent 5954fa0 commit 63e17aa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <IOKit/IOKitLib.h>]])
AC_CHECK_DECLS([IOMasterPort], [], [], [[#include <IOKit/IOKitLib.h>]])

AC_CHECK_FUNCS([host_statistics64], [
AC_CHECK_TYPES([struct vm_statistics64], [], [], [[#include <mach/vm_statistics.h>]])
Expand Down
14 changes: 0 additions & 14 deletions darwin/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 63e17aa

Please sign in to comment.