return the value of a configurable system limit


#include <unistd.h>
#include <limits.h>
long sysconf( int name );


The sysconf() function returns the value of a configurable system limit indicated by name.

Configurable limits are defined in <unistd.h>, and contain at least the following values:

Maximum length of arguments for the exec... functions, in bytes, including environment data.
Maximum number of simultaneous processes per real user ID.
The number of intervals per second used to express the value in type clock_t.
The maximum number of simultaneous supplementary group IDs per process.
Maximum number of files that one process can have open at any given time.
If this variable is defined, job control is supported.
If this variable is defined, each process has a saved set-user-ID and a saved set-group-ID.
The current POSIX version that's currently supported. A value of 198808L indicates the August (08) 1988 standard, as approved by the IEEE Standards Board.


The requested configurable system limit. If name isn't defined for the system, -1 is returned, but errno isn't set. If an error occurs, -1 is returned and errno is set.


name is invalid.


#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <unistd.h>

void main()
    printf( "_SC_ARG_MAX = %ld\n",
         sysconf( _SC_ARG_MAX ) );


POSIX 1003.1

Interrupt handler No
Signal handler Yes
Thread Yes

See also: