mesg(1) on Solnix vs Linux and the BSDs
On Solnix, mesg is the illumos mesg at /usr/bin/mesg. Unlike the other systems' synopses, it accepts -n and -y as well as n and y. It also picks the terminal by searching stdin, stdout, then stderr, whereas OpenBSD and NetBSD document only standard error.
The manual pages
- Solnix: mesg(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: mesg(1) sysvinit-3.04
- FreeBSD: mesg(1) 15.1-RELEASE
- OpenBSD: mesg(1) 8.0
- NetBSD: mesg(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
mesg
What Solnix runs
A default Solnix system runs the illumos mesg at /usr/bin/mesg. No other variants are shipped.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| all four | -n and -y option forms | Solnix mesg accepts -n and -y as well as n and y. The Linux, FreeBSD, OpenBSD and NetBSD synopses list only the bare n and y arguments. Scripts that use bare n and y work on all of them.Source: Solnix mesg(1) SYNOPSIS, OPTIONS (-n|n, -y|y); Linux/FreeBSD/OpenBSD/NetBSD mesg(1) SYNOPSIS |
| OpenBSD, NetBSD | which terminal is affected | Solnix mesg uses the first terminal found among standard input, output and error, in that order. OpenBSD and NetBSD describe only the terminal on standard error, so `mesg n < file` or a redirected stderr behaves differently. Source: Solnix mesg(1) DESCRIPTION; OpenBSD mesg(1) DESCRIPTION; NetBSD mesg(1) DESCRIPTION |
| FreeBSD | terminal search order | Solnix and FreeBSD both use the first terminal among standard input, output and error. FreeBSD COMPATIBILITY says older versions used only standard error, which is still how OpenBSD and NetBSD document it. Source: FreeBSD mesg(1) DESCRIPTION, COMPATIBILITY; Solnix mesg(1) DESCRIPTION |
| Linux | which terminal is affected (Linux) | Linux mesg assumes standard input is your terminal. To change another session's setting, redirect input, e.g. `mesg n < /dev/pts/46`. The Solnix page does not give this example, and says the terminal is found by searching stdin, stdout, then stderr. Source: Linux mesg(1) NOTES; Solnix mesg(1) DESCRIPTION |
| OpenBSD, NetBSD | where the status is printed | With no arguments, OpenBSD and NetBSD print the status to standard error. Solnix and FreeBSD document no stream for the status report on Solnix (the manual does not say) and standard output on FreeBSD. Do not capture the status from stdout in a portable script. Source: OpenBSD mesg(1) DESCRIPTION; NetBSD mesg(1) DESCRIPTION; FreeBSD mesg(1) DESCRIPTION; Solnix mesg(1) DESCRIPTION |
| Linux | exit status | Solnix documents exit 0 (messages receivable), 1 (not receivable) and 2 on error. The Linux page documents no exit values. Source: Solnix mesg(1) EXIT STATUS; Linux mesg(1) (no EXIT STATUS section) |
| FreeBSD, OpenBSD, NetBSD | error exit value | Solnix returns exactly 2 on error. FreeBSD, OpenBSD and NetBSD document >1 for an error. Exit 0 and 1 have the same meaning on all four. Source: Solnix mesg(1) EXIT STATUS; FreeBSD/OpenBSD/NetBSD mesg(1) EXIT STATUS |
| FreeBSD, OpenBSD, NetBSD | default state | FreeBSD, OpenBSD and NetBSD state that write access is allowed by default. The Solnix page does not state a default. Source: FreeBSD/OpenBSD/NetBSD mesg(1) DESCRIPTION; Solnix mesg(1) DESCRIPTION |
| all four | privileged senders | Solnix says processes with appropriate privileges may send messages to the terminal regardless of the mesg state. The other four pages do not say this. Source: Solnix mesg(1) DESCRIPTION; Linux/FreeBSD/OpenBSD/NetBSD mesg(1) DESCRIPTION |
Standards
- POSIX: mesg is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Standard.
- FreeBSD: The mesg utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
- OpenBSD: The mesg utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.
Writing portable scripts
- Use the bare forms `mesg n` and `mesg y` rather than
-nand-y; only Solnix documents the dashed forms. - Do not depend on which stream the status goes to or which terminal is chosen. Test the exit status (0 allowed, 1 not allowed) with stdin attached to the intended terminal.
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.