htop icon indicating copy to clipboard operation
htop copied to clipboard

Fix memory statistics display on FreeBSD/powerpc

Open ghost opened this issue 6 years ago • 2 comments

Use the appropriate types when calling sysctl().

Currently, unsigned long long int is used for all sizes and on FreeBSD/powerpc this causes all sysctl() calls in scanMemoryInfo() to fail as they are actually of different sizes on powerpc, where (sizeof(unsigned long long int), sizeof(u_long)) == (8, 4) vs (8, 8) on amd64. This results in bogus memory sizes being reported by htop.

Signed-off-by: Tobias Kortkamp [email protected]

ghost avatar Dec 24 '18 12:12 ghost

To illustrate: Before patching: https://people.freebsd.org/~tobik/htop-powerpc-bug/before.png After patching: https://people.freebsd.org/~tobik/htop-powerpc-bug/after.png

ghost avatar Dec 24 '18 13:12 ghost

Merged here: htop-dev/htop@ed2b779

natoscott avatar Aug 19 '20 23:08 natoscott