sysconf(3) — Subroutines
NAME
sysconf − Gets configurable system variables
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <unistd.h>
long sysconf(
int name);
PARAMETERS
nameSpecifies the system variable to be queried.
DESCRIPTION
The sysconf() function provides a method for determining the current value of a configurable system limit or whether optional features are supported.
The set of system variables from the limits.h or unistd.h include file that are returned by the sysconf() function, and the symbolic constants, defined in the unistd.h header file that correspond to the name parameter, are as follows:
_AES_OS_VERSION
The integer value indicating the revision of the AES to which the implementation is compliant.
Value of name: _SC_AES_OS_VERSION
ARG_MAX
The maximum length, in bytes, of the arguments for one of the exec functions, including environment data.
Value of name: _SC_ARG_MAX
ATEXIT_MAX
The maximum number of functions that can be registered with atexit() per process.
Value of name: _SC_ATEXIT_MAX
BC_BASE_MAX
The maximum value allowed for the obase variable with the bc command.
Value of name: _SC_BC_BASE_MAX
BC_DIM_MAX
The maximum number of elements permitted in an array by the bc command.
Value of name: _SC_BC_DIM_MAX
BC_SCALE_MAX
The maximum value allowed for the scale variable with the bc command.
Value of name: _SC_BC_SCALE_MAX
BC_STRING_MAX
The maximum length of string constants accepted by the bc command.
Value of name: _SC_BC_STRING_MAX
CHILD_MAX
The maximum number of simultaneous processes for each real user ID.
Value of name: _SC_CHILD_MAX
CLK_TCKThe number of clock ticks per second. The value of CLK_TCK may be variable, and it should not be assumed that CLK_TCK is a compile-time constant.
Value of name: _SC_CLK_TCK
COLL_WEIGHTS_MAX
The maximum number of weights that can be assigned to an entry in the LC_COLLATE locale-dependent information in a locale-definition file
Value of name: _SC_COLL_WEIGHTS_MAX
DATAKEYS_MAX
The maximum number of data keys that may be created per process.
Value of name: _SC_DATAKEYS_MAX
EXPR_NEST_MAX
The maximum number of expressions that can be nested within parentheses by the expr command.
Value of name: _SC_EXPR_NEST_MAX
LINE_MAX
The maximum length, in bytes, of a command’s input line (either standard input or another file) when the utility is described as processing text files. The length includes room for the trailing newline character.
Value of name: _SC_LINE_MAX
NGROUPS_MAX
The maximum number of simultaneous supplementary group IDs for each process.
Value of name: _SC_NGROUPS_MAX
OPEN_MAX
The maximum number of files that one process can have open at one time.
Value of name: _SC_OPEN_MAX
PAGE_SIZE
The page size granularity for memory regions.
Value of name: _SC_PAGE_SIZE
PASS_MAX
The maximum number of characters returned by getpass(), (not including the terminating null character).
Value of name: _SC_PASS_MAX
_POSIX_JOB_CONTROL
This variable has a value of 1 if the system supports job control; otherwise, -1 is returned.
Value of name: _SC_JOB_CONTROL
_POSIX_REENTRANT_FUNCTIONS
This variable has a value of 1 if the system supports POSIX reentrant functions; otherwise, -1 is returned.
Value of name: _SC_REENTRANT_FUNCTIONS
_POSIX_SAVED_IDS
This variable has a value of 1 if each process has a saved set user ID and a saved set group ID; otherwise, -1 is returned.
Value of name: _SC_SAVED_IDS
_POSIX_THREADS
This variable has a value of 1 if the system supports POSIX threads; otherwise, -1 is returned.
Value of name: _SC_THREADS
_POSIX_THREAD_ATTR_STACKSIZE
This variable has a value of 1 if the system supports the POSIX threads stack size attribute; otherwise, -1 is returned.
Value of name: _SC_THREAD_ATTR_STACKSIZE
_POSIX_VERSION
The date of approval of the most current version of the POSIX 1 standard that the system supports. The date is a 6-digit number, with the first 4 digits signifying the year and the last 2 digits the month. Different versions of the POSIX 1 standard are periodically approved by the IEEE Standards Board, and the date of approval is used to distinguish between different versions. If _POSIX_VERSION is defined, it is returned; otherwise, -1 is returned.
Value of name: _SC_VERSION
_POSIX2_C_DEV
This variable has a value of 1 if the system supports the optional C Language Development Utilities from POSIX 2; otherwise, -1 is returned.
Value of name: _SC_2_C_DEV
_POSIX2_FORT_DEV
The variable has a value of 1 if the system supports the FORTRAN Development Utilities Option from POSIX 2; otherwise, -1 is returned.
Value of name: _SC_2_FORT_DEV
_POSIX2_FORT_RUN
The variable has a value of 1 if the system supports the FORTRAN Runtime Utilities Option from POSIX 2; otherwise, -1 is returned.
Value of name: _SC_2_FORT_RUN
_POSIX2_LOCALEDEF
The variable has a value of 1 if the system supports the creation of new locales with the localedef command; otherwise, -1 is returned.
Value of name: _SC_2_LOCALEDEF
_POSIX2_SW_DEV
The variable has a value of 1 if the system supports the Software Development Utilities Option from POSIX 2; otherwise, -1 is returned.
Value of name: _SC_2_SW_DEV
_POSIX2_VERSION
The date of approval of the most current version of the POSIX 2 standard that the system supports. The date is a 6-digit number, with the first 4 digits signifying the year and the last 2 digits the month. Different versions of the POSIX 2 standard are periodically approved by the IEEE Standards Board, and the date of approval is used to distinguish between different versions.
Value of name: _SC_2_VERSION
RE_DUP_MAX
The maximum number of repeated occurrences of a regular expression permitted when using the interval-notation parameters, such as the m and n parameters with the ed command.
Value of name: _SC_RE_DUP_MAX
STREAM_MAX
The number of streams that one process can have open at one time.
Value of name: _SC_STREAM_MAX
TZNAME_MAX
The maximum number of bytes supported for the name of a time zone (not the length of the TZ environmental variable).
Value of name: _SC_TZNAME_MAX
_XOPEN_VERSION
An integer indicating the most current version of the X/OPEN standard that the system supports.
Value of name: _SC_XOPEN_VERSION
NOTES
AES Support Level:
Full use.
RETURN VALUES
If the name parameter is an invalid value, the sysconf() function returns a value of −1, and sets errno to indicate the error. If the variable corresponding to name is undefined, the sysconf() function returns a value of −1 without changing the value of errno.
If the name parameter is _SC_JOB_CONTROL or _SC_SAVED_IDS, the sysconf() function returns a nonnegative value.
Otherwise, the sysconf() function returns the current variable value on the system. The value will not change during the lifetime of the calling process.
ERRORS
If the following condition occurs, the sysconf() function sets errno to the corresponding value:
[EINVAL]The value of the name parameter is invalid.
RELATED INFORMATION
Functions: pathconf(3).
Commands: getconf(1).