sysconf(3)sysconf(3)NAMEsysconf - Get configurable system variables
SYNOPSIS
#include <unistd.h>
long sysconf(
int name );
LIBRARY
Standard C Library (libc)
STANDARDS
Interfaces documented on this reference page conform to industry stan‐
dards as follows:
sysconf(): POSIX.1c, XSH4.2
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
PARAMETERS
Specifies the system variable to be queried.
DESCRIPTION
The sysconf() function provides a method for the application to deter‐
mine the current value of a configurable system limit or whether
optional features are supported.
The following is a list of system variables that are returned by the
sysconf() function, and the symbolic constants (shown in parentheses)
that are the corresponding values used for the name parameter. The
variables come from either the limits.h, unistd.h, or time.h (for
CLK_TCK) header file and the symbolic constants are defined in
unistd.h.
[Tru64 UNIX] Integer value indicating the revision of the AES to which
the implementation is compliant. Maximum length, in bytes, of the
arguments for one of the exec functions, including environment data.
[XSH4.2] Maximum number of functions that can be registered with
atexit() per process. (_SC_ATEXIT_MAX) Maximum value allowed for the
obase variable with the bc command. Maximum number of elements permit‐
ted in an array by the bc command. Maximum value allowed for the scale
variable with the bc command. Maximum length of string constants
accepted by the bc command. Maximum number of simultaneous processes
for each real user ID. 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. Maximum number of weights that can be assigned
to an entry in the LC_COLLATE locale-dependent information in a locale-
definition file Maximum number of expressions that can be nested within
parentheses by the expr command. [XSH4.2] Maximum number of iovec
structures that one process has available for use with readv() or
writev(). Maximum length, in bytes, of a command's input line (either
standard input or another file) when the utility is described as pro‐
cessing text files. The length includes room for the trailing newline
character. Maximum number of simultaneous supplementary group IDs for
each process. Maximum number of files that one process can have open
at one time.
[Tru64 UNIX] In some cases, the per-process soft descriptor
limit is returned instead of the OPEN_MAX value. [XSH4.2] Page
size granularity for memory regions. [XSH4.2] Page size granu‐
larity for memory regions. Maximum number of characters
returned by getpass(), (not including the terminating null char‐
acter). The variable has a value of 1 if the system supports
job control; otherwise, -1 is returned. [POSIX] The variable
has a value of 1 if the system supports POSIX reentrant func‐
tions; otherwise, -1 is returned. The 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. [POSIX] The variable has a
value of 1 if the system supports the POSIX.1 Threads option;
otherwise, -1 is returned. [POSIX] The variable has a value of
1 if the system supports the POSIX.1 Threads Stack Size
attribute option; otherwise, -1 is returned. 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. Dif‐
ferent 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. The variable has a value of 1 if the system supports
the C language binding from POSIX 2; otherwise, -1 is returned.
The variable has a value of 1 if the system supports the
optional C Language Development Utilities from POSIX 2; other‐
wise, -1 is returned. Date of approval of the most current ver‐
sion of the POSIX 2 ISO C 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 ISO C standard are periodically approved by the IEEE
Standards Board, and the date of approval is used to distinguish
between different versions. The variable has a value of 1 if
the system supports at least one terminal; otherwise -1 is
returned. The variable has a value of 1 if the system supports
the FORTRAN Development Utilities Option from POSIX 2; other‐
wise, -1 is returned. The variable has a value of 1 if the sys‐
tem supports the FORTRAN Runtime Utilities Option from POSIX 2;
otherwise, -1 is returned. The variable has a value of 1 if the
system supports the creation of new locales with the localedef
command; otherwise, -1 is returned. The variable has a value of
1 if the system supports the Software Development Utilities
Option from POSIX 2; otherwise, -1 is returned. The variable
has a value of 1 if the system supports the User Portability
Environment Option from POSIX 2; otherwise, -1 is returned.
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 dig‐
its 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.
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. [POSIX] Maximum
number of outstanding asynchronous I/O operations.
[POSIX] Maximum number of I/O operations in a single list I/O
call. [POSIX] The variable has a value of 1 if the system sup‐
ports the POSIX Asynchronous Input and Output option; otherwise
-1 is returned. [POSIX] Maximum number of timer expiration
overruns. [POSIX] The variable has a value of 1 if the system
supports the POSIX.1 File Synchronization option; otherwise -1
is returned. [POSIX] Maximum size of data buffers for get‐
grgid_r and getgrnam_r functions. [POSIX] Maximum size of data
buffers for getpwuid_r and getpwnam_r functions. [POSIX] Maxi‐
mum number of I/O operations in a single list I/O call. Avoid
using _SC_LISTIO_AIO_MAX, which is only retained for backward
compatibility. Use only the CAE-UNIX98-compliant _SC_AIO_LIS‐
TIO_MAX operation. Size in bytes of storage required for a
login name, including the terminating null character.
[POSIX] The variable has a value of 1 if the system supports
the POSIX.1 Memory Mapped Files option; otherwise -1 is
returned. [POSIX] The variable has a value of 1 if the system
supports the POSIX.1 Process Memory Locking option; otherwise -1
is returned. [POSIX] The variable has a value of 1 if the sys‐
tem supports the POSIX.1 Range Memory Locking option; otherwise
-1 is returned. [POSIX] The variable has a value of 1 if the
system supports the POSIX.1 Memory Protection option; otherwise
-1 is returned. [POSIX] The variable has a value of 1 if the
system supports the POSIX.1 Message Passing option; otherwise -1
is returned. [POSIX] Maximum number of open message queue
descriptors a process may hold. [POSIX] Maximum number of mes‐
sage priorities. [POSIX] The variable has a value of 1 if the
system supports the POSIX.1 Prioritized Input and Output option;
otherwise -1 is returned. [POSIX] The variable has a value of
1 if the system supports the POSIX.1 Process Scheduling option;
otherwise -1 is returned. [POSIX] The variable has a value of
1 if the system supports the POSIX.1 Realtime Signals Extension
option; otherwise -1 is returned. [POSIX] Maximum number of
realtime signals reserved for application use. [POSIX] The
variable has a value of 1 if the system supports the POSIX.1
Shared Memory Objects option; otherwise -1 is returned.
[POSIX] The variable has a value of 1 if the system supports
the POSIX.1 Semaphores option; otherwise -1 is returned.
[POSIX] Maximum number of semaphores that a process may have.
[POSIX] Maximum value a semaphore can have. [POSIX] Maximum
number of queued signals that a process may send and have pend‐
ing at the receiver(s) at any time. [POSIX] The variable has a
value of 1 if the system supports the POSIX.1 Synchronized Input
and Output option; otherwise -1 is returned. [POSIX] The vari‐
able has a value of 1 if the system supports the POSIX.1 Thread
Stack Address Attribute option; otherwise -1 is returned.
[POSIX] Maximum number of attempts made to destroy a thread's
thread-specific data values on thread exit. [POSIX] Maximum
number of data keys that can be created per-process.
[POSIX] The variable has a value of 1 if the system supports
the POSIX.1 Priority Inheritance option; otherwise -1 is
returned. [POSIX] The variable has a value of 1 if the system
supports the POSIX.1 Priority Protection option; otherwise -1 is
returned. [POSIX] The variable has a value of 1 if the system
supports the POSIX.1 Thread Execution Scheduling option; other‐
wise -1 is returned. [POSIX] The variable has a value of 1 if
the system supports the POSIX.1 Process-Shared Synchronization
option; otherwise -1 is returned. [POSIX] The variable has a
value of 1 if the system supports the POSIX.1 Thread-Safe Func‐
tions option; otherwise -1 is returned. [POSIX] Minimum size
in bytes of thread stack storage. [POSIX] Maximum number of
threads that can be created per process. [POSIX] Maximum num‐
ber of timers per process. [POSIX] The variable has a value of
1 if the system supports the POSIX.1 Timers option; otherwise -1
is returned. Maximum length of terminal device name. Number of
streams that one process can have open at one time. Maximum
number of bytes supported for the name of a time zone (not the
length of the TZ environmental variable). The variable has a
value of 1 if the system supports the X/Open Encryption Feature
Group; otherwise, -1 is returned. The variable has a value of 1
if the system supports the X/Open Enhanced Internationalization
Feature Group; otherwise, -1 is returned. The variable has a
value of 1 if the system supports the X/Open Shared Memory Fea‐
ture Group; otherwise, -1 is returned. [XSH4.2] The variable
has a value of 1 if the system supports the X/Open UNIX Feature
Group; otherwise, -1 is returned. Integer indicating the most
current version of the X/Open standard that the system supports.
Integer indicating the most current version of the X/Open stan‐
dard for Commands and Utilities that the system supports.
[Tru64 UNIX] The following values of name are supported as part of the
System V Environment for compliance with the System V Release 4.0 with
Multiprocessing (SVR4.0MP) standards: Number of processors in the sys‐
tem. Number of processors currently online.
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.
ERRORS
If the following condition occurs, the sysconf() function sets errno to
the corresponding value: The value of the name parameter is invalid.
SEE ALSO
Functions: pathconf(2)
Commands: getconf(1)
Standards: standards(5)sysconf(3)