wait(1) on Solnix vs Linux and the BSDs
On Solnix, wait is a shell built-in. The page documents it per shell (/bin/sh, jsh, ksh, ksh93, csh), and what you can pass to it and what it returns depend on which shell runs it. The most important difference is that an unknown pid returns 0 in /bin/sh but is treated as exit status 127 in ksh and ksh93.
The manual pages
- Solnix: wait(1) from
pkgs.solnix.illumos-world-man· illumos.org - FreeBSD: wait(1) 15.1-RELEASE
- NetBSD: wait(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
wait
What Solnix runs
A default Solnix system has the illumos wait at /usr/bin/wait. /usr/xpg4/bin/wait is also shipped; the page does not say how the two differ. The page says the shell itself executes wait without creating a process, and that on most implementations wait is a built-in. A standalone wait called outside the shell's execution environment has no known process IDs to wait for. The page gives separate SYNOPSIS and DESCRIPTION sections for /bin/sh, /bin/jsh, /bin/ksh, /usr/xpg4/bin/sh, /bin/csh and ksh93.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD | built-in versus script | FreeBSD lists wait as a builtin of csh(1) and sh(1). It also exists as an external file, but only as a script that calls the shell builtin of the same name. The FreeBSD page in the bundle documents no wait semantics, only this index. Source: FreeBSD wait(1) (builtin index) table, wait row and 'No*' note; Solnix wait(1) DESCRIPTION, USAGE |
| NetBSD | unknown or finished pid: exit status | Solnix /bin/sh and /bin/jsh: a pid that is not an active process makes wait return immediately with 0. Solnix ksh and ksh93 treat an unknown pid as having exited with 127. NetBSD exits >0 when the process did not exist and its status was unavailable.Source: Solnix wait(1) DESCRIPTION (/bin/sh, /bin/jsh; ksh; ksh93), EXIT STATUS; NetBSD wait(1) exit values (>0) |
| NetBSD | job IDs | Solnix jsh, ksh and /usr/xpg4/bin/sh accept '% jobid' operands when job control is enabled. ksh93 also accepts -number (process group), %string, %?string, %+, %% and %-. The NetBSD synopsis is 'wait [pid]' and the page documents no job syntax.Source: Solnix wait(1) SYNOPSIS, OPERANDS (jobid), DESCRIPTION (ksh93); NetBSD wait(1) SYNOPSIS |
| NetBSD | number of operands | Solnix /bin/sh and the other Bourne-family shells take several operands, as in 'wait [pid]...'. In ksh, wait waits for all of them and returns the status of the last operand. The NetBSD synopsis shows a single optional pid.Source: Solnix wait(1) SYNOPSIS, DESCRIPTION (ksh); NetBSD wait(1) SYNOPSIS |
| FreeBSD, NetBSD | csh wait | Solnix /bin/csh wait takes no operands and waits for background processes. The FreeBSD index lists wait as a csh builtin, but the bundle shows nothing on its operands. The NetBSD page covers only 'wait [pid]'.Source: Solnix wait(1) SYNOPSIS (/bin/csh), DESCRIPTION (csh); FreeBSD wait(1) table, wait row; NetBSD wait(1) SYNOPSIS |
| FreeBSD, NetBSD | no operands: exit status | With no operands, Solnix /bin/sh and ksh wait for all background or known processes and return 0. ksh93 returns 0 once all known processes have terminated. NetBSD also returns 0 in this case, once all background children have ended.Source: Solnix wait(1) DESCRIPTION (/bin/sh; ksh; ksh93), EXIT STATUS; NetBSD wait(1) exit value 0 |
| NetBSD | death by signal | The NetBSD page says that if the awaited process was killed by a signal, wait's exit status carries that termination status. The Solnix page does not document this case. Source: NetBSD wait(1) DESCRIPTION (last paragraph); Solnix wait(1) EXIT STATUS |
| FreeBSD, NetBSD | pipelines and subshells | Solnix says not all processes of a pipeline with three or more stages are children of the shell, so they cannot be waited for. wait in (wait), nohup wait, or find -exec wait \; returns immediately. The FreeBSD and NetBSD pages in the bundle do not mention these cases.Source: Solnix wait(1) DESCRIPTION, USAGE; NetBSD wait(1) DESCRIPTION |
Standards
- POSIX: wait is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Committed. The Standard attribute says 'See standards(7).'
- NetBSD: The wait command is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.
- FreeBSD: The FreeBSD page in the bundle is the shell builtin index and shows no STANDARDS section.
Writing portable scripts
- Run wait inside the same shell that started the background jobs, never via (wait), nohup wait or find
-exec, and give it explicit pids with $! rather than job syntax such as %1. - Do not rely on the exit status of wait for a pid that may already be gone: Solnix
/bin/shreturns 0, ksh returns 127, and NetBSD returns a value >0.
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.