tsort(1) on Solnix vs Linux and the BSDs
On Solnix, tsort is the illumos /usr/bin/tsort. It takes no options, only an optional file operand. FreeBSD has -d, -l and -q, and OpenBSD adds -f, -h, -r, -v and -w, so scripts that use those flags fail on Solnix.
The manual pages
- Solnix: tsort(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: tsort(1) coreutils-full-9.11
- FreeBSD: tsort(1) 15.1-RELEASE
- OpenBSD: tsort(1) 8.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
tsort
What Solnix runs
A default Solnix system runs the illumos tsort at /usr/bin/tsort. No other variants are shipped. The Solnix page documents the SYNOPSIS `tsort [file]` and no options.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD, OpenBSD, NetBSD | -q and -l options | Solnix tsort has no options. FreeBSD and OpenBSD accept -q (suppress cycle messages) and -l (search for and display the longest cycle). A script that passes either flag will not work against the Solnix synopsis. The bundle has no NetBSD tsort page, so nothing is claimed for NetBSD.Source: Solnix tsort(1) SYNOPSIS; FreeBSD tsort(1) -l, -q; OpenBSD tsort(1) -l, -q |
| OpenBSD | OpenBSD-only options | OpenBSD has -f, -h file, -r, -v and -w. These cover tie-breaking order, a hints file, reversing the relation, reporting broken edges and exiting with the cycle count. None of them exists in the Solnix synopsis.Source: OpenBSD tsort(1) -f, -h, -r, -v, -w; Solnix tsort(1) SYNOPSIS |
| FreeBSD | -d debugging option | FreeBSD has -d to turn on debugging. Solnix tsort has no -d.Source: FreeBSD tsort(1) -d; Solnix tsort(1) SYNOPSIS |
| FreeBSD, OpenBSD | cycle handling | FreeBSD and OpenBSD ignore one arc in a cycle, continue the sort and report the cycle on standard error. The Solnix page does not describe what happens when the input contains a cycle. Source: FreeBSD tsort(1) DESCRIPTION; OpenBSD tsort(1) DESCRIPTION; Solnix tsort(1) DESCRIPTION |
| OpenBSD | exit status | Solnix and OpenBSD both document exit 0 on success and >0 on error. OpenBSD -w instead exits with the number of cycles broken. Solnix has no such option.Source: Solnix tsort(1) EXIT STATUS; OpenBSD tsort(1) EXIT STATUS, -w |
| Linux | stdin operand and options | Linux tsort reads standard input when FILE is omitted or is `-`, and has only --help and --version. Solnix says only that standard input is used when no file operand is given. The Solnix page does not mention `-` as an operand.Source: Linux tsort(1) DESCRIPTION, --help, --version; Solnix tsort(1) OPERANDS |
| FreeBSD, OpenBSD | input format | Solnix describes the input as pairs of items separated by blanks, where a pair of identical items marks presence only. FreeBSD and OpenBSD describe the same self-arc idea. They also require an even number of node names, which the Solnix page does not state. Source: Solnix tsort(1) DESCRIPTION; FreeBSD tsort(1) DESCRIPTION; OpenBSD tsort(1) DESCRIPTION |
| FreeBSD | multibyte characters | FreeBSD documents that tsort does not recognize multibyte characters. Solnix lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH as affecting tsort. The Solnix page does not say how multibyte input is handled. Source: FreeBSD tsort(1) BUGS; Solnix tsort(1) ENVIRONMENT VARIABLES |
Standards
- POSIX: tsort is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Standard.
- OpenBSD: The tsort utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flags [
-fhlqrvw] are extensions to that specification.
Writing portable scripts
- Use only `tsort [file]` or read standard input in portable scripts. Leave out
-q,-l,-d,-f,-h,-r,-vand-w, which are not in the Solnix synopsis. - Do not depend on how cycles are reported or what exit status results. The Solnix page does not specify cycle behaviour, and OpenBSD
-wchanges the exit status.
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.