gcore(1) on Solnix vs Linux and the BSDs
On Solnix, gcore is the illumos /usr/bin/gcore. It dumps one or more running processes, and its core file location and content are controlled through coreadm(8). Its -c flag takes a content specification, whereas FreeBSD -c takes an output file name, so scripts using -c break across systems.
The manual pages
- Solnix: gcore(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: gcore(1) gdb-17.2
- FreeBSD: gcore(1) 15.1-RELEASE
What Solnix runs
A default Solnix system runs the illumos gcore at /usr/bin/gcore. No other variants are shipped. The Linux counterpart is the GDB gcore. The Solnix page does not mention GDB.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD | -c meaning | Solnix gcore -c content selects what the core file contains, using the same tokens as coreadm(8). FreeBSD gcore -c core names the output file. The same flag means different things.Source: Solnix gcore(1) -c; FreeBSD gcore(1) -c |
| Linux | no -c on Linux | The Linux gcore page documents no -c option and no way to choose core content other than -a. Solnix -c content has no Linux equivalent in the bundle.Source: Linux gcore(1) SYNOPSIS and OPTIONS; Solnix gcore(1) -c |
| Linux, FreeBSD | output file naming | Solnix -o filename replaces the 'core' part of core.process-id, and may contain coreadm(8) tokens. Linux -o prefix gives prefix.pid. FreeBSD has no -o: the name is core.<pid>, or whatever -c gives.Source: Solnix gcore(1) DESCRIPTION, -o; Linux gcore(1) -o; FreeBSD gcore(1) -c, DESCRIPTION |
| Linux, FreeBSD | coreadm-controlled placement | Solnix -p writes to the per-process core location, and -g to the global core repository, as configured by coreadm(8). Either fails if the user lacks permission. Linux and FreeBSD document no such options.Source: Solnix gcore(1) -p, -g; Linux gcore(1) OPTIONS; FreeBSD gcore(1) OPTIONS |
| Linux | -d is not an output directory | Linux gcore -d directory sets the data directory used when invoking GDB, not where the core is written. Solnix gcore has no -d.Source: Linux gcore(1) -d; Solnix gcore(1) SYNOPSIS |
| Linux, FreeBSD | dumping all mappings | Linux -a dumps all memory mappings. FreeBSD -f dumps all available segments except malformed and undumpable ones, and warns that it may disturb device state. The Solnix page has no equivalent flag.Source: Linux gcore(1) -a; FreeBSD gcore(1) -f; Solnix gcore(1) OPTIONS |
| all four | -F force | Solnix -F grabs a process even if another process controls it. The page warns that two controlling processes can lead to chaos. Linux and FreeBSD have no such flag. The FreeBSD page says gcore may fail on processes under truss(1) or gdb(1).Source: Solnix gcore(1) -F, USAGE; FreeBSD gcore(1) BUGS; Linux gcore(1) OPTIONS |
| FreeBSD | -k kernel dump | FreeBSD -k uses the ptrace(2) PT_COREDUMP kernel facility to write the dump. The Solnix page has no such option.Source: FreeBSD gcore(1) -k; Solnix gcore(1) OPTIONS |
| FreeBSD | operands | Solnix gcore accepts several process IDs in one call. FreeBSD takes an optional executable and exactly one pid. Linux also accepts several pids. Source: Solnix gcore(1) SYNOPSIS, OPERANDS; FreeBSD gcore(1) SYNOPSIS; Linux gcore(1) SYNOPSIS |
| Linux | -h and -v | Linux gcore -h prints help and -v prints the version. The Solnix synopsis lists neither, so -v and -h are not documented options there.Source: Linux gcore(1) -h, -v; Solnix gcore(1) SYNOPSIS |
| Linux, FreeBSD | core size limit | The Solnix page says gcore is unaffected by setrlimit(2) RLIMIT_CORE. The Linux page says the file equals a kernel core made with 'ulimit -c' set, but does not say whether the limit applies to gcore. The FreeBSD page does not say.Source: Solnix gcore(1) NOTES; Linux gcore(1) DESCRIPTION; FreeBSD gcore(1) DESCRIPTION |
| Linux, FreeBSD | exit status | Solnix documents exit 0 on success and non-zero on failure, such as a non-existent process ID. The Linux and FreeBSD pages in the bundle document no exit status. Source: Solnix gcore(1) EXIT STATUS; Linux gcore(1); FreeBSD gcore(1) |
Standards
- POSIX: gcore is not a POSIX.1-2024 utility.
- Solnix: Interface Stability: the command syntax is Evolving and the output formats are Unstable.
- FreeBSD: A gcore utility appeared in 4.2BSD. The FreeBSD gcore is not compatible with the original 4.2BSD version.
Writing portable scripts
- Do not use
-cin portable scripts: it selects content on Solnix and a file name on FreeBSD, and does not exist on Linux. Run gcore on one pid and rename the resulting core.<pid> file afterwards. - Name the output with the default core.<pid> pattern, which all three pages document. Solnix
-oand Linux-ouse different forms, and FreeBSD has no-o.
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.