This interface is defined by IEEE Std 1003.1-1988 (“POSIX.1”). 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
name argument specifies the system variable to be queried. Symbolic constants for each name value are found in the include file
<unistd.h>.
The available values are as follows:
_SC_ATEXIT_MAX
The maxmimum number of functions that may be registered with
atexit(3).
_SC_BARRIERS
The version of IEEE Std 1003.1 (“POSIX.1”) and its Barriers option to which the system attempts to conform, otherwise -1.
_SC_CLOCK_SELECTION
Return the POSIX version the implementation of the Clock Selection Option on this system conforms to, or -1 if unavailable.
_SC_CHILD_MAX
The maximum number of simultaneous processes per user id.
_SC_CLK_TCK
The number of clock ticks per second.
_SC_FSYNC
Return 1 if the File Synchronization Option is available on this system, otherwise -1.
_SC_HOST_NAME_MAX
The maximum size of a hostname, including NULL.
_SC_JOB_CONTROL
Return 1 if job control is available on this system, otherwise -1.
_SC_LOGIN_NAME_MAX
Returns the size of the storage required for a login name, in bytes, including the terminating NUL.
_SC_MAPPED_FILES
Return 1 if the Memory Mapped Files Option is available on this system, otherwise -1.
_SC_MEMLOCK
Return 1 if the Process Memory Locking Option is available on this system, otherwise -1.
_SC_MEMLOCK_RANGE
Return 1 if the Range Memory Locking Option is available on this system, otherwise -1.
_SC_MEMORY_PROTECTION
Return 1 if the Memory Protection Option is available on this system, otherwise -1.
_SC_MONOTONIC_CLOCK
Return the POSIX version the implementation of the Monotonic Clock Option on this system conforms to, or -1 if unavailable.
_SC_NGROUPS_MAX
The maximum number of supplemental groups.
_SC_OPEN_MAX
The maximum number of open files per process.
_SC_PAGESIZE
The size of a system page in bytes.
_SC_PASS_MAX
The maximum length of the password, not counting NULL.
_SC_READER_WRITER_LOCKS
The version of IEEE Std 1003.1 (“POSIX.1”) and its Read-Write Locks option to which the system attempts to conform, otherwise -1.
_SC_REGEXP
Return 1 if POSIX regular expressions are available on this system, otherwise -1.
_SC_SEMAPHORES
The version of IEEE Std 1003.1 (“POSIX.1”) and its Semaphores option to which the system attempts to conform, otherwise -1.
Availability of the Semaphores option depends on the
P1003_1B_SEMAPHORE kernel option.
_SC_SHELL
Return 1 if POSIX shell is available on this system, otherwise -1.
_SC_SPIN_LOCKS
The version of IEEE Std 1003.1 (“POSIX.1”) and its Spin Locks option to which the system attempts to conform, otherwise -1.
_SC_STREAM_MAX
The minimum maximum number of streams that a process may have open at any one time.
_SC_SYMLOOP_MAX
The maximum number of symbolic links that may be expanded in a path name.
_SC_SYNCHRONIZED_IO
Return 1 if the Synchronized I/O Option is available on this system, otherwise -1.
_SC_THREADS
The version of IEEE Std 1003.1 (“POSIX.1”) and its Threads option to which the system attempts to conform, otherwise -1.
_SC_TIMERS
The version of IEEE Std 1003.1 (“POSIX.1”) and its Timers option to which the system attempts to conform, otherwise -1.
_SC_TZNAME_MAX
The minimum maximum number of types supported for the name of a timezone.
_SC_SAVED_IDS
Returns 1 if saved set-group and saved set-user ID is available, otherwise -1.
_SC_VERSION
The version of ISO/IEC 9945 (POSIX 1003.1) with which the system attempts to comply.
_SC_XOPEN_SHM
Return 1 if the X/Open Portability Guide Issue 4.2 (“XPG4.2”) Shared Memory option is available on this system, otherwise -1.
Availability of the Shared Memory option depends on the
SYSVSHM kernel option.
_SC_BC_BASE_MAX
The maximum ibase/obase values in the
bc(1) utility.
_SC_BC_DIM_MAX
The maximum array size in the
bc(1) utility.
_SC_BC_SCALE_MAX
The maximum scale value in the
bc(1) utility.
_SC_BC_STRING_MAX
The maximum string length in the
bc(1) utility.
_SC_COLL_WEIGHTS_MAX
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 POSIX 1003.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 POSIX 1003.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.
_SC_NPROCESSORS_CONF
The number of processors configured.
_SC_NPROCESSORS_ONLN
The number of processors online (capable of running processes).