This interface is defined by
St -p1003.1-88 .
A far more complete interface is available using
sysctl(3).
The
sysconf ();
function provides a method for applications to determine the current
value of a configurable system limit or option variable.
The
Fa name
argument specifies the system variable to be queried.
Symbolic constants for each name value are found in the include file
In unistd.h .
Shell programmers who need access to these parameters should use the
getconf(1)
utility.
The maximum number of weights that can be assigned to any entry of
the LC_COLLATE order keyword in the locale definition file.
_SC_EXPR_NEST_MAX
The maximum number of expressions that can be nested within
parenthesis by the
expr(1)
utility.
_SC_LINE_MAX
The maximum length in bytes of a text-processing utility's input
line.
_SC_RE_DUP_MAX
The maximum number of repeated occurrences of a regular expression
permitted when using interval notation.
_SC_2_VERSION
The version of
St -p1003.2
with which the system attempts to comply.
_SC_2_C_BIND
Return 1 if the system's C-language development facilities support the
C-Language Bindings Option, otherwise -1.
_SC_2_C_DEV
Return 1 if the system supports the C-Language Development Utilities Option,
otherwise -1.
_SC_2_CHAR_TERM
Return 1 if the system supports at least one terminal type capable of
all operations described in
St -p1003.2 ,
otherwise -1.
_SC_2_FORT_DEV
Return 1 if the system supports the FORTRAN Development Utilities Option,
otherwise -1.
_SC_2_FORT_RUN
Return 1 if the system supports the FORTRAN Runtime Utilities Option,
otherwise -1.
_SC_2_LOCALEDEF
Return 1 if the system supports the creation of locales, otherwise -1.
_SC_2_SW_DEV
Return 1 if the system supports the Software Development Utilities Option,
otherwise -1.
_SC_2_UPE
Return 1 if the system supports the User Portability Utilities Option,
otherwise -1.
These values also exist, but may not be standard:
_SC_PHYS_PAGES
The number of pages of physical memory.
Note that it is possible that the product of this value and the value of
_SC_PAGESIZE
will overflow a
Vt long
in some configurations on a 32bit machine.
RETURN VALUES
If the call to
sysconf ();
is not successful, -1 is returned and
errno
is set appropriately.
Otherwise, if the variable is associated with functionality that is not
supported, -1 is returned and
errno
is not modified.
Otherwise, the current variable value is returned.
ERRORS
The
sysconf ();
function may fail and set
errno
for any of the errors specified for the library function
sysctl(3).
In addition, the following error may be reported:
Except for the fact that values returned by
sysconf ();
may change over the lifetime of the calling process,
this function conforms to
St -p1003.1-88 .
HISTORY
The
sysconf ();
function first appeared in
BSD 4.4
BUGS
The value for _SC_STREAM_MAX is a minimum maximum, and required to be
the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously
small and misleading number.