prctl(1) on Solnix vs Linux and the BSDs
prctl is the illumos command at /usr/bin/prctl. It gets or sets resource controls on a running process, task, project or zone, selected by id. Linux prlimit and FreeBSD rctl do similar jobs under different names and models, so no flags carry over; even the same letters (-n, -r) mean different things.
The manual pages
- Solnix: prctl(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: prlimit(1) util-linux-2.42.3 (different command, similar job)
- FreeBSD: rctl(8) 15.1-RELEASE (different command, similar job)
What Solnix runs
A default Solnix system runs the illumos prctl at /usr/bin/prctl, published in pkgs.solnix.illumos-world-man. No other variants are shipped. The bundle has no OpenBSD or NetBSD counterpart page, so nothing is said about them. See resource_controls(7) for the list of controls and rctladm(8) for the global side.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD | what is controlled | prctl -i idtype takes process (default), task, project or zone ids. prlimit works on one process (--pid) or on a command it runs. FreeBSD rctl rules have a subject of process, user, loginclass or jail.Source: Solnix prctl(1) -i; Linux prlimit(1) SYNOPSIS, DESCRIPTION; FreeBSD rctl(8) -u |
| Linux | limit model | prctl values have a type chosen with -t: basic, privileged or system (basic is assumed when setting). prlimit changes a soft:hard pair, where soft must not exceed hard.Source: Solnix prctl(1) -t; Linux prlimit(1) DESCRIPTION |
| FreeBSD | rules versus live values | FreeBSD rctl manages a database of rules, and changing a rule affects all running and future matching processes. The prctl page describes examining and modifying controls on an active entity and does not mention a rule database. Source: FreeBSD rctl(8) NAME, DESCRIPTION; Solnix prctl(1) DESCRIPTION |
| Linux | running a command under a limit | prlimit can run a command with the given limits. The prctl synopsis only takes ids of existing processes, tasks, projects or zones, and an id is required. Source: Linux prlimit(1) SYNOPSIS, DESCRIPTION; Solnix prctl(1) SYNOPSIS, OPERANDS |
| FreeBSD | -n and -r meanings | In prctl, -n names the resource control and -r replaces a value. In rctl, -n shows user IDs numerically and -r removes matching rules. On Solnix, deleting a value is -x.Source: Solnix prctl(1) -n, -r, -x; FreeBSD rctl(8) -n, -r |
| FreeBSD | output options | prctl -P prints values space delimited, and its parsable output is Committed. rctl -h prints human-readable units (Byte to Petabyte). The prctl page has no -h.Source: Solnix prctl(1) -P, ATTRIBUTES; FreeBSD rctl(8) -h |
| Linux, FreeBSD | get versus modify | prctl treats an invocation as a get unless -s, -r, -x, -v, -d or -e is given. -v alone implies -s. -s needs -v. rctl uses separate options (-a, -r, -l, -u).Source: Solnix prctl(1) OPTIONS -s, OPTIONS (final paragraph); FreeBSD rctl(8) SYNOPSIS |
| Linux, FreeBSD | actions on exceeding a value | prctl -e or -d enables or disables an action (all, deny, signal, signal=signum) on a value. The prlimit and rctl texts in the bundle describe no equivalent option.Source: Solnix prctl(1) -d | -e action; Linux prlimit(1) DESCRIPTION; FreeBSD rctl(8) OPTIONS |
| Linux, FreeBSD | privilege to modify | Changing privileged controls with prctl needs root-equivalent privileges unless the lowerable flag is set. An unprivileged user querying an entity with different credentials gets a failure. The other two pages do not describe privilege requirements. Source: Solnix prctl(1) -t, OPERANDS; Linux prlimit(1); FreeBSD rctl(8) |
| Linux, FreeBSD | exit status | prctl exits 0 on success, 1 on a fatal error and 2 for invalid options. rctl documents only 0 and >0. The prlimit page in the bundle has no exit status section. Source: Solnix prctl(1) EXIT STATUS; FreeBSD rctl(8) EXIT STATUS; Linux prlimit(1) |
Everyday tasks
| Task | Solnix | Linux | FreeBSD |
|---|---|---|---|
| show limits of a process | prctl pid | prlimit --pid PID | rctl -l filter |
| show one named limit | prctl -n name pid | prlimit --resource=limits --pid PID | rctl filter |
| set a limit on a running process | prctl -n name -v value -p pid id | prlimit --resource=soft:hard --pid PID | rctl -a rule |
| remove a limit | prctl -x -n name id | — | rctl -r filter |
| show current resource usage | prctl id | — | rctl -u filter |
| limits of a task, project or zone | prctl -i task|project|zone id | — | rctl -u filter (subject user, loginclass or jail) |
| machine-readable output | prctl -P | — | — |
Standards
- POSIX: prctl is not a POSIX.1-2024 utility.
- Solnix: Interface Stability: the command-line syntax is Committed, the human-readable output is Uncommitted, and the parsable output is Committed.
- Linux: The prlimit(1) page refers to ulimit(1p) and prlimit(2) in SEE ALSO and says prlimit(2) is supported since Linux 2.6.36.
- FreeBSD: The rctl command appeared in FreeBSD 9.0. The page cites no standard.
Writing portable scripts
- There is no portable flag set: branch on the tool present (prctl, prlimit, rctl) and write each branch separately.
- On Solnix, parse prctl
-Poutput rather than the default output, since only the parsable output is Committed.
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.