getconf(1) getconf(1)
NAME
getconf - get configuration values
SYNOPSIS
getconf systemvar
getconf -64s systemvar
getconf pathvar pathname
DESCRIPTION
In the first synopsis form, getconf writes the value of the variable
specified by the systemvar operand to the standard output.
In the second synopsis form, getconf supplies 64-bit values of the
variables LONGMAX and ULONGMAX.
In the third synopsis form, getconf writes the value of the variable
specified by the pathvar operand to the standard output. This value
is valid within the path specified by the pathname operand.
The value of each configuration variable is output as if it were
determined by calling the function from which it was defined (see
OPERANDS). The value reflects the conditions in the current execution
environment.
If the specified variable is valid, but is not defined on the system,
getconf writes undefined to the standard output.
OPERANDS
pathvar
Name of a configuration variable whose value can be obtained
using the pathconf(2) function. All of the values listed in the
following table are supported:
LINKMAX
MAXCANON
MAXINPUT
NAMEMAX
PATHMAX
PIPEBUF
POSIXCHOWNRESTRICTED
POSIXNOTRUNC
POSIXVDISABLE
Note: All variable names can be specified with or without a lead-
ing underscore (_).
pathname
Pathname for which the variable specified by pathvar is to be
determined.
Page 1 Reliant UNIX 5.44 Printed 11/98
getconf(1) getconf(1)
systemvar
Name of a configuration variable whose value can be obtained
using the confstr(3C) or sysconf(3C) functions. All of the values
listed in the following table are supported:
ARGMAX
BCBASEMAX
BCDIMMAX
BCSCALEMAX
BCSTRINGMAX
BEILENMAX
CHARCLASSNAMEMAX
CHARBIT
CHARMAX
CHARMIN
CHILDMAX
CLKTCK
COLLWEIGHTSMAX
CSPATH
EXPRNESTMAX
INTMAX
INTMIN
LINEMAX
LONGBIT
LONGMAX
LONGMIN
NGROUPSMAX
NLARGMAX
NLLANGMAX
NLMSGMAX
NLNMAX
NLSETMAX
NLTEXTMAX
NZERO
OPENMAX
POSIX2BCBASEMAX
POSIX2BCDIMMAX
POSIX2BCSCALEMAX
POSIX2BCSTRINGMAX
POSIX2CHARTERM
POSIX2COLLWEIGHTSMAX
POSIX2CBIND
POSIX2CDEV
POSIX2CVERSION
POSIX2EXPRNESTMAX
POSIX2FORTDEV
POSIX2FORTRUN
POSIX2LINEMAX
POSIX2LOCALEDEF
POSIX2REDUPMAX
POSIX2SWDEV
POSIX2UPE
Page 2 Reliant UNIX 5.44 Printed 11/98
getconf(1) getconf(1)
POSIX2VERSION
POSIXARGMAX
POSIXCHILDMAX
POSIXJOBCONTROL
POSIXLINKMAX
POSIXMAXCANON
POSIXMAXINPUT
POSIXNAMEMAX
POSIXNGROUPSMAX
POSIXOPENMAX
POSIXPATHMAX
POSIXPIPEBUF
POSIXSAVEDIDS
POSIXSSIZEMAX
POSIXSTREAMMAX
POSIXTZNAMEMAX
POSIXVERSION
REDUPMAX
SCHARMAX
SCHARMIN
SHRTMAX
SHRTMIN
SSIZEMAX
STREAMMAX
TMPMAX
TZNAMEMAX
UCHARMAX
UINTMAX
ULONGMAX
USHRTMAX
WORDBIT
XOPENCRYPT
XOPENENHI18N
XOPENSHM
XOPENVERSION
XOPENXCUVERSION
XOPENXPG2
XOPENXPG3
XOPENXPG4
The symbol PATH is also recognized. It returns the same value as
the confstr(3C) value CSPATH. getconf also recognizes the vari-
ables LOGNAMEMAX, PAGESIZE, PAGESIZE, and PASSMAX.
Note: All variable names can be specified with or without a lead-
ing underscore (_).
Page 3 Reliant UNIX 5.44 Printed 11/98
getconf(1) getconf(1)
ENVIRONMENT VARIABLES
The following environment variables affect the execution of getconf:
LANG Provides a default value for the internationalization
variables that are unset or null. If LANG is unset or
null, the corresponding default value from the interna-
tionalized environment is used. If one of the interna-
tionalization variables contains an invalid setting, the
command behaves as if none of the variables have been
defined.
LCALL If this variable has been assigned a value, i.e. it is
not a null string, this value overrides the values of all
the other internationalization variables.
LCCTYPE Determines the internationalized environment for the
interpretation of byte strings as characters (e.g.
single-byte characters as opposed to multi-byte charac-
ters in arguments).
LCMESSAGES Determines the format and contents of error messages.
NLSPATH Determines the position of message catalogs for the pro-
cessing of LCMESSAGES.
EXIT STATUS
The following exit values are returned:
0 The specified variable is valid and information about its current
status was written to the standard output.
>0 An error occurred.
EXAMPLES
In this example, the value of {NGROUPSMAX} is obtained:
getconf NGROUPSMAX
In this example, the value of {NAMEMAX} is obtained for a specific
directory:
getconf NAMEMAX /usr
This example shows how to deal more carefully with results that might
be unspecified:
if value=$(getconf PATHMAX /usr); then
if [ "$value" = "undefined" ]; then
echo PATHMAX in /usr is infinite.
else
echo PATHMAX in /usr is $value.
fi
Page 4 Reliant UNIX 5.44 Printed 11/98
getconf(1) getconf(1)
else
echo Error in getconf.
fi
Note that the following calls in a C program could return different
results:
sysconf(SCPOSIXCBIND);
and:
system("getconf POSIX2CBIND");
The sysconf(3C) call returns a value that corresponds to the condi-
tions when the program is either compiled or executed. The system(3S)
call to getconf always returns a value that corresponds to the condi-
tions when the program is executed.
SEE ALSO
pathconf(2), confstr(3C), sysconf(3C).
Page 5 Reliant UNIX 5.44 Printed 11/98