sysconf(2) CLIX sysconf(2)
NAME
sysconf - Retrieves configurable system variables
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <unistd.h>
long sysconf(
int name );
PARAMETERS
name Specifies the system attribute to be queried. The following table
lists the set of system variables from <limits.h>, <unistd.h>, or
<time.h> (for CLK_TCK) that can be returned by sysconf() and the
symbolic constants, defined in <unistd.h> that are the
corresponding values used for the parameter, name.
ARG_MAX
(_SC_ARG_MAX) Specifies the maximum length of arguments (in
bytes) for the exec() functions.
CHILD_MAX
(_SC_CHILD_MAX) Specifies the maximum number of processes
for each real user ID.
CLK_TCK
(_SC_CLK_TCK) Specifies the number of clock ticks per
second.
NGROUPS_MAX
(_SC_NGROUPS_MAX) Specifies the maximum number of
supplementary group IDs per process.
OPEN_MAX
(_SC_OPEN_MAX) Specifies the maximum number of files that
one process can have open at a time.
_POSIX_JOB_CONTROL
(_SC_JOB_CONTROL) If this symbol is defined, the
implementation supports job control.
_POSIX_SAVED_IDS
(_SC_SAVED_IDS) If defined, each process has a saved set-
user-ID and a saved set-group-ID.
2/94 - Intergraph Corporation 1
sysconf(2) CLIX sysconf(2)
_POSIX_VERSION
(_SC_VERSION) Specifies the integer value of ``1988 08L.''
This value changes with each published version or revision
of the POSIX standard to indicate the year and month that
the standard has approved.
STREAM_MAX
(_SC_STREAM_MAX) Specifies the maximum number of streams
that one process can have open at a time.
TZNAME_MAX
(_SC_TZNAME_MAX) Specifies the maximum length of a timezone
name.
DESCRIPTION
The sysconf() function provides a method for the application to determine
the current value of a configurable system limit or variable.
EXAMPLES
To determine the maximum number of supplementary groups:
#include <unistd.h>
int max_groups;
if ((max_groups = sysconf(_SC_NGROUPS_MAX)) == -1)
perror("sysconf failed");
RETURN VALUES
If name is not valid, sysconf() returns -1 and sets errno to indicate the
error. Otherwise, sysconf() returns the current variable value on the
system. The value returned will not be more restrictive than the
corresponding value described to the application when it was compiled with
the implementations's <limits.h> or <unistd.h>.
ERRORS
The sysconf() function fails if the following is true:
[EINVAL] The value of name is not valid.
RELATED INFORMATION
Functions: pathconf(2)
Files: limits.h(0), unistd.h(0)
2 Intergraph Corporation - 2/94