clear_locks(8) on Solnix vs Linux and the BSDs
On Solnix, clear_locks is the illumos command at /usr/sbin/clear_locks. It removes all file, record and share locks that a named host holds on the local host. Unlike FreeBSD, it also has -s, which clears locks the current machine holds on a server.
The manual pages
- Solnix: clear_locks(8) from
pkgs.solnix.illumos-world-man· illumos.org - FreeBSD: clear_locks(8) 15.1-RELEASE
What Solnix runs
A default Solnix system runs the illumos clear_locks at /usr/sbin/clear_locks. No other variants are shipped. Linux, OpenBSD and NetBSD have no counterpart page in the bundle, so the manual says nothing about them.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD | -s option | Solnix clear_locks has -s, which removes all locks created by the current machine and held by the server hostname. The FreeBSD synopsis is only clear_locks hostname and documents no options.Source: Solnix clear_locks(8) SYNOPSIS, OPTIONS -s; FreeBSD clear_locks(8) SYNOPSIS |
| FreeBSD | what is cleared | Solnix states that it removes all file, record and share locks created by hostname and held on the current host, whichever process owns them. FreeBSD says only that it clears file locks held by an NFS client. Source: Solnix clear_locks(8) DESCRIPTION; FreeBSD clear_locks(8) DESCRIPTION |
| FreeBSD | privilege requirement | Solnix says the command can be run only by the super-user and exits 1 if you are not root. The FreeBSD page does not mention any privilege requirement. Source: Solnix clear_locks(8) DESCRIPTION, EXIT STATUS 1; FreeBSD clear_locks(8) DESCRIPTION |
| FreeBSD | exit status | Solnix documents exit codes: 0 success, 1 not root, 2 usage error, 3 unable to contact the server (RPC). The FreeBSD page has no EXIT STATUS section, so scripts cannot rely on specific codes there. Source: Solnix clear_locks(8) EXIT STATUS; FreeBSD clear_locks(8) (no EXIT STATUS section) |
| FreeBSD | warning about active clients | Solnix warns that clearing locks held by an active client may make applications fail unexpectedly. The FreeBSD page only says to use it after a client crash and does not give this warning. Source: Solnix clear_locks(8) DESCRIPTION; FreeBSD clear_locks(8) DESCRIPTION |
| FreeBSD | related pages | Solnix refers to fcntl(2) and attributes(7). FreeBSD refers to rpc.lockd(8). The Solnix page does not name a lock daemon. Source: Solnix clear_locks(8) SEE ALSO; FreeBSD clear_locks(8) SEE ALSO |
Standards
- POSIX: clear_locks is not a POSIX.1-2024 utility.
- FreeBSD: HISTORY: A version of clear_locks appeared in SunOS 4.
Writing portable scripts
- Do not pass
-sin scripts that must also run on FreeBSD: its page documents only clear_locks hostname. - Do not depend on exit codes 1 to 3 outside Solnix: only the Solnix page documents them.
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.