SYSCONF(2P) — UNIX Programmer’s Manual
NAME
sysconf − (POSIX only) get configurable system variables
SYNOPSIS
#include <unistd.h>
long sysconf(int name);
DESCRIPTION
The information in this specification applies only to POSIX applications.
The sysconf function provides a method for an application to determined the current value of a configurable system limit or option.
The name argument represents the system variable to be queried. The following variables are supported:
Variable name Value
{ARG_MAX} {_SC_ARG_MAX}
{CHILD_MAX} {_SC_CHILD_MAX}
{clock ticks/second} {_SC_CLK_TCK}
{NGROUPS_MAX} {_SC_NGROUPS_MAX}
{OPEN_MAX} {_SC_OPEN_MAX}
{STREAM_BUF} {_SC_STREAM_BUF}
{TZNAME_MAX} {_SC_TZNAME_MAX}
{_POSIX_JOB_CONTROL} {_SC_JOB_CONTROL}
{_POSIX_SAVED_IDS} {_SC_SAVED_IDS}
{_POSIX_VERSION} {_SC_VERSION}
The meaning of each variable is as follows:
Variable Description
{ARG_MAX} Maximum length of all arguments + environment strings to exec().
{CHILD_MAX} Maximum number of simultaneous processes per real user ID.
{clock ticks/second} The number of clock ticks per second.
{NGROUPS_MAX} Maximum number of simultaneous supplementary group IDs per process.
{OPEN_MAX} Maximum number of simultaneous open files per process.
{STREAM_BUF} The number of streams that one process can have open at one time.
{TZNAME_MAX} The maximum number of bytes supported for the name of a time zone.
{_POSIX_JOB_CONTROL} If defined, the system supports POSIX job control.
{_POSIX_SAVED_IDS} If defined, saved set-user-IDs and set-group-IDS are supported.
{_POSIX_VERSION} The version of POSIX supported by the system.
The values for the variables above are given in the headers <limits.h> or <unistd.h>. The symbolic constants used as values for name are given in <unistd.h>.
RETURN VALUE
Upon successful completion sysconf returns the current variable value on the system. If name is an invalid value, sysconf returns −1. If the variable corresponding to name is associated with functionality that is not supported by the system, sysconf shall return −1 without changing the value of errno.
ERRORS
If any of the following conditions occur, sysconf returns −1 and set errno to the corresponding value:
[EINVAL] The value of name is invalid.
POSIX 1003.1 — August 1, 1992