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.

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 withTopicWhat differs
FreeBSD, OpenBSD, NetBSD-q and -l optionsSolnix 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
OpenBSDOpenBSD-only optionsOpenBSD 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 optionFreeBSD has -d to turn on debugging. Solnix tsort has no -d.
Source: FreeBSD tsort(1) -d; Solnix tsort(1) SYNOPSIS
FreeBSD, OpenBSDcycle handlingFreeBSD 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
OpenBSDexit statusSolnix 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
Linuxstdin operand and optionsLinux 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, OpenBSDinput formatSolnix 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
FreeBSDmultibyte charactersFreeBSD 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, -v and -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 -w changes 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.