sysconf(3)sysconf(3)Namesysconf - get configurable system variables (POSIX)
Syntax
#include <unistd.h>
long sysconf(name)
int name;
Description
The function provides a method for the application to determine the
current value of a configurable system limit or option.
The name argument represents the system variable to be queried. The
following table lists the system variables which may be queried and the
corresponding value for the name argument. The values for the name
argument are defined in the <unistd.h> header file.
Variable name Value
ARG_MAX _SC_ARG_MAX
CHILD_MAX _SC_CHILD_MAX
CLK_TCK _SC_CLK_TCK
NGROUPS_MAX _SC_NGROUPS_MAX
OPEN_MAX _SC_OPEN_MAX
PASS_MAX _SC_PASS_MAX
_POSIX_JOB_CONTROL _SC_JOB_CONTROL
_POSIX_SAVED_IDS _SC_SAVED_IDS
_POSIX_VERSION _SC_VERSION
_XOPEN_VERSION _SC_XOPEN_VERSION
Return Values
Upon successful completion, the function returns the current variable
value on the system.
If name is an invalid value, returns -1 and errno is set to indicate
the reason. If the variable corresponding to name is not defined on the
system, returns -1 without changing the value of errno.
Diagnostics
The function fails if the following occurs:
[EINVAL] The value of the name argument is invalid.
sysconf(3)