htop icon indicating copy to clipboard operation
htop copied to clipboard

macOS: OSX 10.4 Tiger compatibility

Open glebm opened this issue 8 months ago • 5 comments

2 changes to make htop compatible with OSX 10.4 Tiger

  1. mach_host_self() and vm_page_size are defined in mach_init.h.
  2. <libproc.h> API is not available, related functionality is disabled.

htop builds and works but cannot display per-process CPU% and task%. This can hopefully be improved in the future but at least it builds for now.

image

/cc @barracuda156

glebm avatar Apr 27 '25 09:04 glebm

@glebm We have a breakage outside of Tiger, at least up to 10.6: https://github.com/htop-dev/htop/issues/1686 (update: up to 10.10, as it follows from Apple docs).

(It is not seen on Tiger, of course, once you just disable the whole of related code, but a proper fix should be more nuanced.)

barracuda156 avatar Apr 27 '25 09:04 barracuda156

Disabling huge chunks of the existing code may have very adverse effects. Please refine this patch in a way that it works more localized.

BenBE avatar Apr 27 '25 11:04 BenBE

I have no idea how to make it more localized, considering that the entire <libproc.h> API is missing on 10.4.

glebm avatar Apr 27 '25 12:04 glebm

Thank you for the review, I'll get back to it next weekend. In the meantime, I figured out how to get some of the info on Tiger (though it requires root for privileged processes).

glebm avatar Apr 27 '25 18:04 glebm

Thank you for the review, I'll get back to it next weekend. Take the time you need. With #1688 at least the immediate breakage from 10.6 onward should be taken care of.

In the meantime, I figured out how to get some of the info on Tiger (though it requires root for privileged processes). This sound good to hear. If information are unavailable for some processes, this usually is not a problem. Some columns include some marker for "N/A" data that should be used in these cases.

BenBE avatar Apr 27 '25 19:04 BenBE