mkstr(1b) on Solnix vs Linux and the BSDs
On Solnix, mkstr is the illumos BSD-compatibility command at /usr/ucb/mkstr, not in the standard /usr/bin. It does the same job as FreeBSD mkstr: it pulls error(" strings out of C source into a message file. The pages differ mainly in wording, example output and the extra FreeBSD sections.
The manual pages
- Solnix: mkstr(1b) from
pkgs.solnix.illumos-world-man· illumos.org - FreeBSD: mkstr(1) 15.1-RELEASE
What Solnix runs
A default Solnix system runs the illumos mkstr at /usr/ucb/mkstr, which is the only variant shipped. It is published in pkgs.solnix.illumos-world-man as mkstr(1b). Because it lives in /usr/ucb, it is on PATH only if that directory is in PATH.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD | command location | Solnix documents mkstr only as /usr/ucb/mkstr (section 1b). The FreeBSD page gives the bare name mkstr in section 1. A Solnix script that calls plain mkstr may not find it unless /usr/ucb is on PATH.Source: Solnix mkstr(1b) SYNOPSIS (/usr/ucb/mkstr); FreeBSD mkstr(1) SYNOPSIS |
| FreeBSD | synopsis and the - option | Both systems take the same arguments: an optional -, a message file, a prefix and one or more source files. Both say - makes mkstr place the new messages at the end of the existing message file, for recompiling part of a large program. Source: Solnix mkstr(1b) SYNOPSIS, OPTIONS; FreeBSD mkstr(1) SYNOPSIS, Options |
| FreeBSD | generated error() sample | The sample code in the Solnix page calls perror(efilname) and exit(1) on failure, and lseek(efil, (long) a1, 0). The FreeBSD sample calls err(1, "%s", efilname) and lseek with (off_t)a1 and SEEK_SET. The manuals show the model, not exact output of each tool. Source: Solnix mkstr(1b) DESCRIPTION (code example); FreeBSD mkstr(1) DESCRIPTION (code example) |
| FreeBSD | message terminator | Both pages say each message is stored followed by a null character and a newline. Only the Solnix page explains why: the null ends the message for retrieval, and the newline lets you cat the file. Source: Solnix mkstr(1b) DESCRIPTION; FreeBSD mkstr(1) DESCRIPTION |
| FreeBSD | usefulness warning | The FreeBSD page has a BUGS section saying mkstr was meant for the PDP 11, very few programs use it, and the memory savings are negligible on modern computers. The Solnix page has no such warning and presents the memory saving as a benefit. Source: FreeBSD mkstr(1) BUGS; Solnix mkstr(1b) DESCRIPTION |
| FreeBSD | related pages | Solnix SEE ALSO lists xstr(1) and attributes(7). FreeBSD lists gencat(1), xstr(1) and lseek(2) and has a HISTORY section (first appeared in 1BSD). The Solnix page has no HISTORY section. Source: Solnix mkstr(1b) SEE ALSO; FreeBSD mkstr(1) SEE ALSO, HISTORY |
| Linux, OpenBSD, NetBSD | no counterpart page | The bundle has no mkstr page for Linux, OpenBSD or NetBSD, so the manual does not say whether the command exists there. Source: Bundle header (only a freebsd counterpart is listed) |
Standards
- POSIX: mkstr is not a POSIX.1-2024 utility.
- FreeBSD: The FreeBSD page has no STANDARDS section. Its HISTORY says mkstr first appeared in 1BSD.
Writing portable scripts
- Do not depend on mkstr in portable build scripts. The bundle shows it only on Solnix (in
/usr/ucb) and FreeBSD, and the FreeBSD page says it is rarely used and saves little memory today.
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.