HELPLIB.HLB  —  CRTL  sysconf
    Gets configurable system variables.

    Format

      #include  <unistd.h>

      long int sysconf  (int name);

1  –  Argument

 name

    Specifies the system variable to be queried.

2  –  Description

    The sysconf function provides a method for determining the
    current value of a configurable system limit or whether optional
    features are supported.

    You supply a symbolic constant in the name argument, and sysconf
    returns a value for the corresponding system variable:

    o  The symbolic constants defined in the <unistd.h> header file.

    o  The system variables are defined in the <limits.h> and
       <unistd.h> header files.

    sysconf Argument and Return Values lists the system variables
    returned by the sysconf function, and the symbolic constants that
    you can supply as the name value.

    Table REF-10 sysconf Argument and Return Values

                      Symbolic
    System Variable   Constant for
    Returned          name           Meaning

    ISO POSIX-1

    ARG_MAX           _SC_ARG_MAX    The maximum length, in bytes,
                                     of the arguments for one of
                                     the exec functions, including
                                     environment data.
    CHILD_MAX         _SC_CHILD_     The maximum number of
                      MAX            simultaneous processes for each
                                     real user ID.
    CLK_TCK           _SC_CLK_TCK    The number of clock ticks per
                                     second. The value of CLK_TCK
                                     can be variable. Do not assume
                                     that CLK_TCK is a compile-time
                                     constant.
    NGROUPS_MAX       _SC_NGROUPS_   The maximum number of
                      MAX            simultaneous supplementary group
                                     IDs for each process.
    OPEN_MAX          _SC_OPEN_MAX   The maximum number of files that
                                     one process can have open at one
                                     time.
    STREAM_MAX        _SC_STREAM_    The number of streams that one
                      MAX            process can have open at one
                                     time.
    TZNAME_MAX        _SC_TZNAME_    The maximum number of bytes
                      MAX            supported for the name of a time
                                     zone (not the length of the TZ
                                     environmental variable).
    _POSIX_JOB_       _SC_JOB_       This variable has a value of
    CONTROL           CONTROL        1 if the system supports job
                                     control; otherwise, -1 is
                                     returned.
    _POSIX_SAVED_IDS  _SC_SAVED_     This variable has a value of 1
                      IDS            if each process has a saved set
                                     user ID and a saved set group
                                     ID; otherwise, -1 is returned.
    _POSIX_VERSION    _SC_VERSION    The date of approval of the
                                     most current version of the
                                     POSIX-1 standard that the system
                                     supports. The date is a 6-digit
                                     number, with the first 4 digits
                                     signifying the year and the last
                                     2 digits the month.

                                     If_POSIX_VERSION is not defined,
                                     -1 is returned.

                                     Different versions of the POSIX-
                                     1 standard are periodically
                                     approved by the IEEE Standards
                                     Board, and the date of approval
                                     is used to distinguish between
                                     different versions.

    ISO POSIX-2

    BC_BASE_MAX       _SC_BC_BASE_   The maximum value allowed for
                      MAX            the obase variable with the bc
                                     command.
    BC_DIM_MAX        _SC_BC_DIM_    The maximum number of elements
                      MAX            permitted in an array by the bc
                                     command.
    BC_SCALE_MAX      _SC_BC_        The maximum value allowed for
                      SCALE_MAX      the scale variable with the bc
                                     command.
    BC_STRING_MAX     _SC_BC_        The maximum length of string
                      STRING_MAX     constants accepted by the bc
                                     command.
    COLL_WEIGHTS_MAX  _SC_COLL_      The maximum number of weights
                      WEIGHTS_MAX    that can be assigned to an
                                     entry in the LC_COLLATE locale-
                                     dependent information in a
                                     locale definition file.
    EXPR_NEST_MAX     _SC_EXPR_      The maximum number of
                      NEST_MAX       expressions that you can nest
                                     within parentheses by the expr
                                     command.
    LINE_MAX          _SC_LINE_MAX   The maximum length, in bytes,
                                     of a command input line (either
                                     standard input or another file)
                                     when the utility is described
                                     as processing text files. The
                                     length includes room for the
                                     trailing new-line character.
    RE_DUP_MAX        _SC_RE_DUP_    The maximum number of repeated
                      MAX            occurrences of a regular
                                     expression permitted when using
                                     the interval notation arguments,
                                     such as the m and n arguments
                                     with the ed command.
    _POSIX2_CHAR_     _SC_2_CHAR_    This variable has a value of 1
    TERM              TERM           if the system supports at least
                                     one terminal type; otherwise, -1
                                     is returned.
    _POSIX2_C_BIND    _SC_2_C_BIND   This variable has a value of
                                     1 if the system supports the
                                     C language binding option;
                                     otherwise, -1 is returned.
    _POSIX2_C_DEV     _SC_2_C_DEV    This variable has a value of
                                     1 if the system supports the
                                     optional C Language Development
                                     Utilities from the ISO POSIX-
                                     2 standard; otherwise, -1 is
                                     returned.
    _POSIX2_C_        _SC_2_C_       Integer value indicating the
    VERSION           VERSION        version of the ISO POSIX-2
                                     standard (C language binding).
                                     It changes with each new version
                                     of the ISO POSIX-2 standard.
    _POSIX2_VERSION   _SC_2_         Integer value indicating the
                      VERSION        version of the ISO POSIX-2
                                     standard (Commands). It changes
                                     with each new version of the ISO
                                     POSIX-2 standard.
    _POSIX2_FORT_DEV  _SC_2_FORT_    The variable has a value of 1 if
                      DEV            the system supports the Fortran
                                     Development Utilities Option
                                     from the ISO POSIX-2 standard;
                                     otherwise, -1 is returned.
    _POSIX2_FORT_RUN  _SC_2_FORT_    The variable has a value of
                      RUN            1 if the system supports the
                                     Fortran Runtime Utilities Option
                                     from the ISO POSIX-2 standard;
                                     otherwise, -1 is returned.
    _POSIX2_          _SC_2_         The variable has a value of
    LOCALEDEF         LOCALEDEF      1 if the system supports the
                                     creation of new locales with the
                                     localedef command; otherwise, -1
                                     is returned.
    _POSIX2_SW_DEV    _SC_2_SW_DEV   The variable has a value of 1 if
                                     the system supports the Software
                                     Development Utilities Option
                                     from the ISO POSIX-2 standard;
                                     otherwise, -1 is returned.
    _POSIX2_UPE       _SC_2_UPE      The variable has a value of 1
                                     if the system supports the User
                                     Portability Utilities Option;
                                     otherwise, -1 is returned.

    POSIX 1003.1c-1995

    _POSIX_THREADS    _SC_THREADS    This variable has a value of 1
                                     if the system supports POSIX
                                     threads; otherwise, -1 is
                                     returned.
    _POSIX_THREAD_    _SC_THREAD_    This variable has a value of 1
    ATTR_STACKSIZE    ATTR_          if the system supports the POSIX
                      STACKSIZE      threads stack size attribute;
                                     otherwise, -1 is returned.
    _POSIX_THREAD_    _SC_THREAD_    The 1003.1c implementation
    PRIORITY_         PRIORITY_      supports the realtime scheduling
    SCHEDULING        SCHEDULING     functions.
    _POSIX_THREAD_    _SC_THREAD_    TRUE if the implementation
    SAFE_FUNCTIONS    SAFE_          supports the thread-safe ANSI
                      FUNCTIONS      C functions in POSIX 1003.1c.
    PTHREAD_          _SC_THREAD_    When a thread terminates,
    DESTRUCTOR_       DESTRUCTOR_    DECthreads iterates through
    ITERATIONS        ITERATIONS     all non-NULL thread-specific
                                     data values in the thread, and
                                     calls a registered destructor
                                     routine (if any) for each. It
                                     is possible for a destructor
                                     routine to create new values for
                                     one or more thread-specific data
                                     keys. In that case, DECthreads
                                     goes through the entire process
                                     again.

                                     _SC_THREAD_DESTRUCTOR_ITERATIONS
                                     is the maximum number of times
                                     the implementation loops before
                                     it terminates the thread even if
                                     there are still non-NULL values.
    PTHREAD_KEYS_MAX  _SC_THREAD_    The maximum number of thread-
                      KEYS_MAX       specific data keys that an
                                     application can create.
    PTHREAD_STACK_    _SC_THREAD_    The minimum allowed size of a
    MIN               STACK_MIN      stack for a new thread. Any
                                     lower value specified for the
                                     "stacksize" thread attribute is
                                     rounded up.
    UINT_MAX          _SC_THREAD_    The maximum number of threads
                      THREADS_MAX    an application is allowed to
                                     create. Since DECthreads does
                                     not enforce any fixed limit,
                                     this value is -1.

    X/Open

    _XOPEN_VERSION    _SC_XOPEN_     An integer indicating the
                      VERSION        most current version of the
                                     X/Open standard that the system
                                     supports.
    PASS_MAX          _SC_PASS_MAX   Maximum number of significant
                                     bytes in a password (not
                                     including terminating null).
    XOPEN_CRYPT       _SC_XOPEN_     This variable has a value of
                      CRYPT          1 if the system supports the
                                     X/Open Encryption Feature Group;
                                     otherwise, -1 is returned.
    XOPEN_ENH_I18N    _SC_XOPEN_     This variable has a value
                      ENH_I18N       of 1 if the system supports
                                     the X/Open enhanced
                                     Internationalization Feature
                                     Group; otherwise, -1 is
                                     returned.
    XOPEN_SHM         _SC_XOPEN_     This variable has a value
                      SHM            of 1 if the system supports
                                     the X/Open Shared Memory
                                     Feature Group; otherwise, -1
                                     is returned.

    X/Open Extended

    ATEXIT_MAX        _SC_ATEXIT_    The maximum number of functions
                      MAX            that you can register with
                                     atexit per process.
    PAGESIZE          _SC_PAGESIZE   Size, in bytes, of a page.
    PAGE_SIZE         _SC_PAGE_      Same as PAGESIZE. If either
                      SIZE           PAGESIZE or PAGE_SIZE is
                                     defined, the other is defined
                                     with the same value.
    IOV_MAX           _SC_IOV_MAX    Maximum number of iovec
                                     structures that one process
                                     has available for use with readv
                                     or writev.
    XOPEN_UNIX        _SC_XOPEN_     This variable has a value of
                      UNIX           1 if the system supports the
                                     X/Open CAE Specification, August
                                     1994, System Interfaces and
                                     Headers, Issue 4, Version 2,
                                     (ISBN: 1-85912-037-7, C435);
                                     otherwise, -1 is returned.

    Other

    N/A               _SC_CPU_       Returns information for
                      CHIP_TYPE      the processor type. See the
                                     description after this table.

    For the _SC_CPU_CHIP_TYPE symbolic constant:

    o  On Alpha servers, sysconf returns the architecture type (2),
       as given by the $GETSYI system service.

    o  Integrity processor information is stored in CPUID register
       3. This register contains a 64-bit integer divided into 1-byte
       fields indicating version information related to the processor
       implementation. The sysconf function returns the low-order
       longword with the following information:

       31     24 23    16 15    8 7     0
       ----------------------------------
       | family | model  | rev   |number|
       ----------------------------------

    These fields are described in the following table:

    Field  Bits   Description

    number 7:0    Index of the largest implemented CPUID register
                  (one less than the number of implemented CPUID
                  registers). This value will be at least 4.
    rev    15:8   Processor revision number. An 8-bit value that
                  represents the revision or stepping of this
                  processor implementation within the processor
                  model.
    model  23:16  Processor model number. A unique 8-bit value
                  representing the processor model within the
                  processor family.
    family 31:24  Processor family number. A unique 8-bit value
                  representing the processor family.

3  –  Return Values

    x                  The current variable value on the system. The
                       value does not change during the lifetime of
                       the calling process.
    -1                 Indicates an error.

                       If the value of the name argument is invalid,
                       errno is set to indicate the error.

                       If the value of the name argument is
                       undefined, errno is unchanged.
Close Help