sysconf(3P) INTERACTIVE UNIX System (POSIX) sysconf(3P)
NAME
sysconf - get system configuration information
SYNOPSIS
#include <unistd.h>
long sysconf (name)
int name;
DESCRIPTION
The sysconf() function provides a method for the application
to determine the current value of a configurable system
limit or option (variable).
The name argument represents the system variable to be
queried. The implementation shall support all of the vari-
ables listed in the following table and may support others.
The variables in the table come from <limits.h> or
<unistd.h> (or <time.h> from the C Standard for {CLK_TCK})
and the symbolic constants, defined in <unistd.h>, that are
the corresponding values used for name.
Configurable System Variables
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}
{_POSIX_JOB_CONTROL} {_SC_JOB_CONTROL}
{_POSIX_SAVED_IDS} {_SC_SAVED_IDS}
{_POSIX_VERSION} {_SC_VERSION}
The value of {CLK_TCK} is permitted to be evaluated at run-
time by the C Standard (and thus by this standard). The
value returned by sysconf() for {_SC_CLK_TCK} will be the
same as that returned by {CLK_TCK}.
DIAGNOSTICS
If name is an invalid value, sysconf() shall return -1. If
the variable corresponding to name is not defined on the
system, sysconf() will return -1 without changing the value
of errno.
Otherwise, the sysconf() function returns the current vari-
able value on the system. The value returned shall not be
more restrictive than the corresponding value described to
the application when it was compiled with the
implementation's <limits.h> or <unistd.h>. The value shall
not change during the lifetime of the calling process.
ERROR MESSAGES
If any of the following conditions occur, the sysconf()
function shall return -1 and set errno to the corresponding
Rev. 1.1 Page 1
sysconf(3P) INTERACTIVE UNIX System (POSIX) sysconf(3P)
value:
[EINVAL] The value of the name argument is invalid.
Rev. 1.1 Page 2