kstat(8) on Solnix vs Linux and the BSDs
On Solnix, kstat is the illumos kstat at /usr/bin/kstat. It selects statistics with options (-m, -i, -n, -s, -c) or a module:instance:name:statistic operand. OpenBSD's kstat is a different program with the same name: its only option is -w, and its fourth field is a unit, not a statistic. Only OpenBSD has a counterpart page; Linux, FreeBSD and NetBSD have none in the bundle.
The manual pages
- Solnix: kstat(8) from
pkgs.solnix.illumos-world-man· illumos.org - OpenBSD: kstat(1) 8.0
What Solnix runs
A default Solnix system runs the illumos kstat at /usr/bin/kstat. No other variants are shipped. The page is published as section 8 (kstat(8)) in the Solnix manual.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| OpenBSD | same name, different program | Solnix kstat reads illumos kernel statistics and has many selection options. OpenBSD kstat displays OpenBSD kernel statistics and has one option, -w. Option names and output do not carry over between them.Source: Solnix kstat(8) SYNOPSIS, OPTIONS; OpenBSD kstat(1) SYNOPSIS |
| OpenBSD | repeat interval | Solnix takes the repeat interval as a positional operand, [interval [count]], and can stop after count reports. OpenBSD uses -w wait for the interval, and its page documents no count.Source: Solnix kstat(8) OPERANDS (interval, count); OpenBSD kstat(1) -w |
| OpenBSD | fourth field of the selector | Solnix selector is module:instance:name:statistic, where statistic is the label of a value inside a kstat. OpenBSD selector is provider:instance:name:unit, where unit is an unsigned integer such as a ring number. Same shape, different meaning of the last field. Source: Solnix kstat(8) OPERANDS; OpenBSD kstat(1) DESCRIPTION (unit) |
| OpenBSD | instance values and matching | Solnix instance numbers start from zero and index entities such as disks, and instance can be a glob or a /regex/. OpenBSD says all statistics currently use instance 0 and instance is an unsigned integer. OpenBSD patterns are glob(7) only. Source: Solnix kstat(8) DESCRIPTION, OPTIONS; OpenBSD kstat(1) DESCRIPTION (instance, provider) |
| OpenBSD | filter options | Solnix has -c class, -m module, -i instance, -n name and -s statistic, and the tests are ANDed. OpenBSD has no filter options: arguments restrict the display, and data matching at least one argument is shown.Source: Solnix kstat(8) OPTIONS; OpenBSD kstat(1) DESCRIPTION |
| OpenBSD | output formats | Solnix kstat has -p (parsable, with -V for values only), -C (colon-separated) and -j (JSON), plus -T u|d for timestamps. The OpenBSD page documents none of these and gives no output format options.Source: Solnix kstat(8) -p, -C, -j, -T; OpenBSD kstat(1) SYNOPSIS |
| OpenBSD | listing and quiet mode | Solnix -l lists matching names without values, and -q prints nothing and only sets the exit status. OpenBSD lists the supported four-component arguments by running kstat with no argument, and has no quiet option.Source: Solnix kstat(8) -l, -q; OpenBSD kstat(1) DESCRIPTION (last paragraph) |
| OpenBSD | exit status | Solnix kstat exits 0 if any statistic matched, 1 if none matched, 2 for invalid options and 3 for a fatal error. OpenBSD documents only 0 on success and >0 on error. A script testing for a match with exit 1 works only on Solnix. Source: Solnix kstat(8) EXIT STATUS; OpenBSD kstat(1) EXIT STATUS |
| Linux, FreeBSD, NetBSD | no counterpart page | The bundle has no kstat page for Linux, FreeBSD or NetBSD, so the manual gives no basis for comparing them. Do not assume kstat exists there. Source: Bundle header: only an openbsd counterpart is listed |
Standards
- POSIX: kstat is not a POSIX.1-2024 utility.
- Solnix: The Solnix page refers to attributes(7) in SEE ALSO but the trimmed text contains no interface stability table.
- OpenBSD: The OpenBSD page has no STANDARDS section; HISTORY says kstat first appeared in OpenBSD 6.8.
Writing portable scripts
- Do not script kstat across Solnix and OpenBSD with shared options: use
-won OpenBSD and the interval operand or-p,-jand-m/-n/-s selectors on Solnix. - On Solnix, quote selectors that contain glob or regex characters such as * or /regex/ so the shell does not expand them.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.