summaryrefslogtreecommitdiffstats
path: root/freebsd/FreeBSDMachine.c
Commit message (Collapse)AuthorAgeFilesLines
* BSD platforms: Reject negative and zero KERN_FSCALE factorsExplorer092023-08-301-1/+1
| | | | | | | | | | | | | | The "fscale" value, retrieved by sysctl() in BSD platforms, is used for computing CPU percentages of the processes. To prevent a division by zero, we should reject a zero "fscale" value. (A negative "fscale" value will not make sense either.) For DragonFlyBSD and FreeBSD, this would fall back to the hard-coded default scale. For NetBSD and OpenBSD, there is no hard-coded default value, so the zero or negative "fscale" is now a fatal error. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Replace isnan() with better comparisons (isgreater(), etc.)Explorer092023-08-181-10/+7
| | | | | | | | | | | | | | | | | | The standard isnan() function is defined to never throw FP exceptions even when the argument is a "signaling" NaN. This makes isnan() more expensive than (x != x) expression unless the compiler flag '-fno-signaling-nans' is given. Introduce functions isNaN(), isNonnegative(), isPositive(), sumPositiveValues() and compareRealNumbers(), and replace isnan() in htop's codebase with the new functions. These functions utilize isgreater() and isgreaterequal() comparisons, which do not throw FP exceptions on "quiet" NaNs, which htop uses extensively. With isnan() removed, there is no need to suppress the warning '-Wno-c11-extensions' in FreeBSD. Remove the code from 'configure.ac'. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Build fixes for FreeBSDXimalas2023-05-091-3/+3
| | | | Part of a series of changes to get rid of errors and warnings.
* Adapt platform code for the new Machine base classNathan Scott2023-05-081-0/+396
Move host-centric data to new derived <Platform>Machine classes, separate from process-list-centric data.

© 2014-2024 Faster IT GmbH | imprint | privacy policy