htop/netbsd
Benny Baumann b42c441ee0 Use proper metric to detect kernel threads
Querying kernel threads with `ps -o pid,lid,flags,state,lname -sp 0`
gives that kernel threads have state `K` and flags have mask `0x20000` set.
This corresponds to `LW_SYSTEM` in kernel which is mapped as `L_SYSTEM`/`P_SYSTEM` for userspace.
2021-08-16 08:03:57 +02:00
..
NetBSDProcess.c Adds support for PROC_EXE and CWD. 2021-06-26 12:18:37 +02:00
NetBSDProcess.h Implements the NetBSD specific changes for makeCommandStr refactor. 2021-06-26 12:18:37 +02:00
NetBSDProcessList.c Use proper metric to detect kernel threads 2021-08-16 08:03:57 +02:00
NetBSDProcessList.h Build fix for NetBSD 2021-08-16 07:45:04 +02:00
Platform.c netbsd: Add NetworkIOMeter support 2021-08-13 22:27:14 +02:00
Platform.h PCP: support for 'dynamic columns' added at runtime 2021-08-13 07:32:57 +02:00
ProcessField.h Update copyright notices 2021-06-26 12:18:37 +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).