Sign in

getconf(1) on Solnix vs Linux and the BSDs

On Solnix, getconf is the illumos getconf at /usr/bin/getconf. It takes -v specification and -a, as POSIX does, and the ksh93 built-in adds many more options. Unlike FreeBSD, OpenBSD and NetBSD, the page documents a ksh93 form that can also set values and list variables by call or standard prefix.

What Solnix runs

A default Solnix system runs the illumos /usr/bin/getconf. /usr/xpg4/bin/getconf and /usr/xpg6/bin/getconf are also shipped with the same synopsis. The page also documents a ksh93 built-in getconf. It is used when getconf is run without a path prefix and the search finds /bin/getconf or /usr/bin/getconf. It accepts -abdlpqrtw, -c, -n, -s, -v and long options. The bundle does not say how the xpg4/xpg6 variants differ from /usr/bin/getconf.

Differences

Compared withTopicWhat differs
all fourksh93 built-in optionsThe Solnix page documents a ksh93 built-in getconf with -b, -c, -d, -l, -n, -p, -q, -r, -s, -t, -w and long forms. The BSD pages document only -a and -v (FreeBSD), -L, -l and -v (OpenBSD), or -a (NetBSD). The bundle has no Linux page.
Source: Solnix getconf(1) SYNOPSIS and OPTIONS (ksh93); FreeBSD/OpenBSD/NetBSD getconf(1) SYNOPSIS
OpenBSD-l meaningIn the Solnix ksh93 built-in, -l lists variable names in lower case. On OpenBSD, -l lists the variables that need no pathname, and -L lists those that need one. Solnix /usr/bin/getconf has neither.
Source: Solnix getconf(1) OPTIONS (ksh93) -l; OpenBSD getconf(1) -L, -l
FreeBSD, OpenBSD, NetBSDsetting valuesIn the ksh93 built-in, giving a value changes the process-local value of a writable variable. Readonly variables cannot be changed. The BSD pages describe only querying.
Source: Solnix getconf(1) DESCRIPTION (ksh93); FreeBSD/OpenBSD/NetBSD getconf(1) DESCRIPTION
FreeBSD, NetBSD-a output and pathnameSolnix /usr/bin/getconf -a writes only the names of the system configuration variables, and takes no file argument. FreeBSD getconf -a [file] reports path variables for a file. NetBSD getconf -a [pathname] prints name = value pairs.
Source: Solnix getconf(1) DESCRIPTION and OPTIONS -a; FreeBSD getconf(1) SYNOPSIS; NetBSD getconf(1) DESCRIPTION
FreeBSD-v environmentFreeBSD documents -v environment as currently doing nothing. Solnix says -v gives the specification that governs the selection of values. The Solnix text in the bundle does not list valid specification names.
Source: FreeBSD getconf(1) Programming Environments; Solnix getconf(1) OPTIONS -v
NetBSD-v supportThe NetBSD synopsis has no -v option. Solnix, FreeBSD and OpenBSD all accept -v.
Source: NetBSD getconf(1) SYNOPSIS; Solnix getconf(1) SYNOPSIS
OpenBSDsynopsis shapeOpenBSD uses one form, getconf [-Ll] [-v specification] name [pathname]. Solnix /usr/bin/getconf keeps separate system_var and path_var pathname forms, and path_var is limited to a listed set such as NAME_MAX, PATH_MAX and PIPE_BUF.
Source: OpenBSD getconf(1) SYNOPSIS; Solnix getconf(1) SYNOPSIS and OPERANDS path_var
FreeBSD, NetBSDvariable namingFreeBSD strips _CS_ from confstr names, so _CS_PATH is queried as PATH. NetBSD strips _SC_ and _PC_ and ignores leading underscores. Solnix lists CS_PATH as a system_var, not PATH.
Source: FreeBSD getconf(1) DESCRIPTION; NetBSD getconf(1) DESCRIPTION; Solnix getconf(1) OPERANDS system_var
FreeBSD, OpenBSD, NetBSDundefined valuesSolnix ksh93 getconf prints undefined for a valid but undefined name. An invalid name gives a diagnostic on standard error and a non-zero exit. FreeBSD also prints undefined. OpenBSD and NetBSD pages do not say.
Source: Solnix getconf(1) DESCRIPTION (ksh93); FreeBSD getconf(1) DESCRIPTION

Everyday tasks

TaskSolnixFreeBSDOpenBSDNetBSD
show the value of a system variablegetconf system_vargetconf system_vargetconf namegetconf system_var
show a variable's value for a given pathgetconf path_var pathnamegetconf path_var filegetconf name pathnamegetconf path_var pathname
list all configuration variablesgetconf -a——getconf -a
show a variable for a given specificationgetconf -v specification system_vargetconf -v environment system_vargetconf -v specification name—

Standards

Writing portable scripts

  • Use only the plain getconf name and getconf path_var pathname forms. Avoid -a, -l and -L: their output and meaning differ between systems.
  • Do not rely on -v. Its effect differs and NetBSD does not list it.

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.