DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

sysconf(S)


sysconf -- get configurable system variables

Syntax

cc ... -lc

#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. In the table that follows, the values in the left column are defined in <limits.h>, except for CLK_TCK, which is defined in <time.h>. The values in the right column are defined in <unistd.h>. The information in the right column comprise the possible values for the name argument.

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}  

 +---------------------+-------------------+-----------------+
 |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}     |                 |
 +---------------------+-------------------+-----------------+

The value returned by sysconf for _SC_CLK_TCK is the same as CLK_TCK.

Return value

If name is an invalid value, sysconf returns a -1. If the variable corresponding to name is not defined on the system, sysconf returns -1 without changing the value of errno.

Otherwise, sysconf returns the current variable value on the system. The value returned is not more restrictive than the corresponding value described to the application when it was compiled with the implementation's <time.h> or <unistd.h>. The value does not change during the lifetime of the calling process.

Diagnostics

If any of the following conditions occur, the sysconf function returns -1 and sets errno to the corresponding value:


[EINVAL]
The value of the name argument is invalid.

Notes

PASS_MAX and _SC_PASS_MAX are XPG3 extensions over POSIX.

Standards conformance

sysconf is conformant with:

IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ;
and NIST FIPS 151-1 .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003