htop/netbsd
Kumar 0af08bcfc9 Process: Display single digit precision for CPU% greater than 99.9%
Since commit edf319e[1], we're dynamically adjusting column width of
"CPU%", showing single digit precision also for values greater than
"99.9%" makes "CPU%" column consistent with all other values.

[1]: edf319e53d

Change "Process_printPercentage()" function's logic to always display
value (i.e. "val") with single precision. Except when value is greater
than "99.9%" for columns like "MEM%", whose width is fixed to "4" and
value cannot go beyond "100%".

Credits: @Explorer09, thanks for the patch[2] to fix title alignment
         issue.

[2]: https://github.com/htop-dev/htop/pull/959#issuecomment-1092480951

Closes: #957
2022-05-26 15:03:39 +02:00
..
NetBSDProcess.c Process: Display single digit precision for CPU% greater than 99.9% 2022-05-26 15:03:39 +02:00
NetBSDProcess.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
NetBSDProcessList.c Auto-size (normalized) CPU usage columns 2022-03-06 19:56:25 +01:00
NetBSDProcessList.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Platform.c Ensure buffer for environment is large enough on NetBSD 2022-05-06 14:35:50 +02:00
Platform.h Mark ScreenDefaults const 2021-12-17 14:45:15 +01:00
ProcessField.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
README.md netbsd: Add battery support 2021-08-05 10:47:14 +02:00

README.md

NetBSD support in htop(1)

This implementation utilizes kvm_getprocs(3), sysctl(3), etc, eliminating the need for mount_procfs(8) with Linux compatibility enabled.

The implementation was initially based on the OpenBSD support in htop(1).

Notes on NetBSD curses

NetBSD is one of the last operating systems to use and maintain its own implementation of Curses.

htop(1) can be compiled against either ncurses or NetBSD's curses(3). In order for NetBSD's libcurses to be used, htop(1) must be configured with --disable-unicode. This is necessary because htop(1) with Unicode enabled directly accesses ncurses's cchar_t struct, which has different contents in NetBSD's curses.

Versions of libcurses in NetBSD 9 and prior have no mouse support (this is an ncurses extension). Newer versions contain no-op mouse functions for compatibility with ncurses.

What needs improvement

  • Kernel and userspace threads are not displayed or counted - maybe look at NetBSD top(1).
  • Support for compiling using libcurses's Unicode support.
  • Support for fstat(1) (view open files, like lsof(8) on Linux).
  • Support for ktrace(1) (like strace(1) on Linux).