


C Library Functions                                   sysconf(3C)



NAME
     sysconf - get configurable system variables

SYNOPSIS
     #include <unistd.h>

     long sysconf(int name);

DESCRIPTION
     The sysconf() function provides a method for an  application
     to  determine  the  current  value  of a configurable system
     limit or option (variable).

     The _n_a_m_e argument  represents  the  system  variable  to  be
     queried. The following table lists the minimal set of system
     variables  from  <limits.h>  and  <unistd.h>  that  can   be
     returned  by sysconf() and the symbolic constants defined in
     <unistd.h> that are the corresponding values used  for  _n_a_m_e
     on the  SPARC and x86 platforms.
     Name                          Return Value                          Meaning
     _SC_2_C_BIND                  _POSIX2_C_BIND                        Supports  the  C  language  binding
                                                                         option
     _SC_2_C_DEV                   _POSIX2_C_DEV                         Supports the C language development
                                                                         utilities option
     _SC_2_C_VERSION               _POSIX2_C_VERSION                     Integer value indicating version of
                                                                         ISO POSIX-2 standard (Commands)
     _SC_2_CHAR_TERM               _POSIX2_CHAR_TERM                     Supports at least one terminal
     _SC_2_FORT_DEV                _POSIX2_FORT_DEV                      Supports FORTRAN Development Utili-
                                                                         ties Option
     _SC_2_FORT_RUN                _POSIX2_FORT_RUN                       Supports FORTRAN  Run-time  Utili-
                                                                         ties Option
     _SC_2_LOCALEDEF               _POSIX2_LOCALEDEF                     Supports the creation of locales by
                                                                         the localedef  utility
     _SC_2_SW_DEV                  _POSIX2_SW_DEV                        Supports the  Software  Development
                                                                         Utility Option
     _SC_2_UPE                     _POSIX2_UPE                           Supports the User Portability Util-
                                                                         ities Option
     _SC_2_VERSION                 _POSIX2_VERSION                       Integer value indicating version of
                                                                         ISO  POSIX-2  standard  (C language
                                                                         binding)
     _SC_AIO_LISTIO_MAX            AIO_LISTIO_MAX                        Max number of I/O operations  in  a
                                                                         single list I/O call supported
     _SC_AIO_MAX                   AIO_MAX                               Max number of outstanding asynchro-
                                                                         nous I/O operations supported

     SC_AIO_PRIO_DELTA_
        MAX
                                   AIO_PRIO_DELTA_MAX                    Max amount by which a  process  can
                                                                         decrease   its   asynchronous   I/O
                                                                         priority   level   from   its   own
                                                                         scheduling priority




SunOS 5.7           Last change: 10 Mar 1998                    1






C Library Functions                                   sysconf(3C)



     _SC_ARG_MAX                   ARG_MAX                               Max size of argv[] plus envp[]
     _SC_ASYNCHRONOUS_IO

     _POSIX_ASYNCHRONOUS_
        IO
                                   Supports          Asynchronous
     I/O
     _SC_ATEXIT_MAX                ATEXIT_MAX                            Max number of functions that may be
                                                                         registered with atexit()
     _SC_AVPHYS_PAGES                                                    Number physical  memory  pages  not
                                                                         currently in use by system
     _SC_BC_BASE_MAX               BC_BASE_MAX                           Maximum _o_b_a_s_e values allowed by the
                                                                         bc  utility
     _SC_BC_DIM_MAX                BC_DIM_MAX                            Max number of elements permitted in
                                                                         array by bc
     _SC_BC_SCALE_MAX              BC_SCALE_MAX                          Max
     _s_c_a_l_e        value        allowed       by                bc

     _SC_BC_STRING_MAX             BC_STRING_MAX                         Max  length  of   string   constant
                                                                         allowed by bc
     _SC_CHILD_MAX                 CHILD_MAX                             Max
     processes       allowed       to       a       UID
     _SC_CLK_TCK                   CLK_TCK                               Ticks
     per                 second                (clock_t)
     _SC_COLL_WEIGHTS_MAX          COLL_WEIGHTS_MAX                      Max number of weights that  can  be
                                                                         assigned to entry of the LC_COLLATE
                                                                         order keyword in locale  definition
                                                                         file
     _SC_DELAYTIMER_MAX            DELAYTIMER_MAX                        Max  number  of  timer   expiration
                                                                         over-
                                                                         runs
     _SC_EXPR_NEST_MAX             EXPR_NEST_MAX                         Max number of expressions that  can
                                                                         be listed within parentheses by the
                                                                         expr  utility
     _SC_FSYNC                     _POSIX_FSYNC                          Supports
     File                                   Synchronization
     _SC_GETGR_R_SIZE_MAX          NSS_BUFLEN_GROUP                      Max
     size        of        group        entry         buffer
     _SC_GETPW_R_SIZE_MAX          NSS_BUFLEN_PASSWD                     Max
     size        of        password        entry         buffer
     _SC_IOV_MAX                   IOV_MAX                               Max number of iovec structures that
                                                                         one  process  has available for use
                                                                         with readv() and writev()
     _SC_JOB_CONTROL               _POSIX_JOB_CONTROL                    Job
     control                              supported
     _SC_LINE_MAX                  LINE_MAX                              Max
     length        of        input        line
     _SC_LOGIN_NAME_MAX            LOGNAME_MAX         +        1
                          Max  length  of  login  name.
     _SC_LOGNAME_MAX               LOGNAME_MAX
     _SC_MAPPED_FILES              _POSIX_MAPPED_FILES                   Supports
     Memory                  Mapped                  Files



SunOS 5.7           Last change: 10 Mar 1998                    2






C Library Functions                                   sysconf(3C)



     _SC_MEMLOCK                   _POSIX_MEMLOCK                        Supports
     Process                  Memory                  Locking.
     _SC_MEMLOCK_RANGE             _POSIX_MEMLOCK_RANGE                  Supports
     Range Memory Locking.

     _SC_MEMORY_
        PROTECTION


     _POSIX_MEMORY_
        PROTECTION
                                   Supports    Memory     Protec-
     tion.
     _SC_MESSAGE_PASSING


     _POSIX_MESSAGE_
        PASSING
                                   Supports     Message     Pass-
     ing.
     _SC_MQ_OPEN_MAX               MQ_OPEN_MAX                           Max number of open message queues a
                                                                         process may hold.
     _SC_MQ_PRIO_MAX               MQ_PRIO_MAX                           Max number  of  message  priorities
                                                                         sup-
                                                                         ported
     _SC_NGROUPS_MAX               NGROUPS_MAX                           Max simultaneous  groups  to  which
                                                                         one may belong
     _SC_NPROCESSORS_CONF                                                Number
     of                 processors                 configured
     _SC_NPROCESSORS_ONLN                                                Number
     of                 processors                 online
     _SC_OPEN_MAX                  OPEN_MAX                              Max
     open           files           per          process
     _SC_PAGESIZE                  PAGESIZE                              System
     memory                 page                 size
     _SC_PAGE_SIZE                 PAGESIZE                              Same
     as                                _SC_PAGESIZE
     _SC_PASS_MAX                  PASS_MAX                              Max number of significant bytes  in
                                                                         a password
     _SC_PHYS_PAGES                                                      Total number of pages  of  physical
                                                                         memory in system
     _SC_PRIORITIZED_IO            _POSIX_PRIORITIZED_IO                 Supports
     Prioritized I/O

     _SC_PRIORITY_
        SCHEDULING


     _POSIX_PRIORITY_
        SCHEDULING
                                   Supports   Process    Schedul-
     ing



SunOS 5.7           Last change: 10 Mar 1998                    3






C Library Functions                                   sysconf(3C)



     _SC_RE_DUP_MAX                RE_DUP_MAX                            Max
     number                of               repeated
     _SC_REALTIME_SIGNALS

     _POSIX_REALTIME_
        SIGNALS
                                   Supports     Realtime     Sig-
     nals.
     _SC_RTSIG_MAX                 RTSIG_MAX                             Max  number  of  realtime   signals
                                                                         reserved for application use
     _SC_SAVED_IDS                 _POSIX_SAVED_IDS                      Saved
     IDs                (seteuid())                 supported?
     _SC_SEM_NSEMS_MAX             SEM_NSEMS_MAX                         Max number  of  semaphores  that  a
                                                                         process may have.
     _SC_SEM_VALUE_MAX             SEM_VALUE_MAX                         Max
     value         a        semaphore        may        have
     _SC_SEMAPHORES                _POSIX_SEMAPHORES                     Supports
     Semaphores

     _SC_SHARED_MEMORY_
        OBJECTS


     _POSIX_SHARED_MEMORY_
        OBJECTS
                                   Supports   Shared    MemoryOb-
     jects
     _SC_SIGQUEUE_MAX              SIGQUEUE_MAX                          Max number of queued signals a pro-
                                                                         cess  may  send and have pending at
                                                                         receiver(s) at a time.
     _SC_STREAM_MAX                STREAM_MAX                            Number of streams one processed can
                                                                         have open at a time

     _SC_SYNCHRONIZED_
        IO


     _POSIX_SYNCHRONIZED_
        IO
                                   Supports          Synchronized
     I/O.

     _SC_THREAD_ATTR_
        STACKADDR


     _POSIX_THREAD_ATTR_
        STACKADDR
                                   Supports   Thread   Stack   Address
                                   Attribute option





SunOS 5.7           Last change: 10 Mar 1998                    4






C Library Functions                                   sysconf(3C)



     _SC_THREAD_ATTR_
        STACKSIZE


     _POSIX_THREAD_ATTR_
        STACKSIZE
                                   Supports Thread Stack  Size  Attri-
                                   bute option

          _SC_THREAD_DESTRUCTOR_         ITERATIONS

     PTHREAD_DESTRUCTOR_
        ITERATIONS
                                   Number  attempts  made  to  destroy
                                   thread-
                                   specific data on thread exit
     _SC_THREAD_KEYS_MAX           PTHREAD_KEYS_MAX                      Max
     number of data keys per process

     _SC_THREAD_PRIO_
        INHERIT


     _POSIX_THREAD_PRIO_
        INHERIT
                                   Supports    Priority    Inheritance
                                   option

     _SC_THREAD_PRIO_
        PROTECT


     _POSIX_THREAD_PRIO_
        PROTECT
                                   Supports  Priority  Protection
     option

     _SC_THREAD_PRIORITY_
        SCHEDULING
                                                                         Supports Thread Execution  Schedul-
                                        _POSIX_THREAD_PRIORITY_          ing option
                                           SCHEDULING

     _SC_THREAD_PROCESS_
        SHARED


     _POSIX_THREAD_PROCESS_
        SHARED
                                   T{
     Supports            Process-Shared           Synchronization
     option



SunOS 5.7           Last change: 10 Mar 1998                    5






C Library Functions                                   sysconf(3C)



     T}

     _SC_THREAD_SAFE_
        FUNCTIONS


     _POSIX_THREAD_SAFE_
        FUNCTIONS
                                   T{
     Supports                Thread-Safe                Functions
     option
     T}
     _SC_THREAD_STACK_MIN          PTHREAD_STACK_MIN                     T{
     Min        byte       size       of       thread       stack
     storage
     T}

     _SC_THREAD_THREADS_
        MAX


     PTHREAD_THREADS_
        MAX
                                   Max number of threads per pro-
     cess                                             _SC_THREADS
                   _POSIX_THREADS                        Supports
     Threads                                   option
     _SC_TIMER_MAX                 TIMER_MAX                             Max
     number         of        timers        per        process
     _SC_TIMERS                    _POSIX_TIMERS                         Supports
     Timers                        _SC_TTY_NAME_MAX
     TTYNAME_MAX                          Max length of tty  dev-
     ice                                               name
     _SC_TZNAME_MAX                TZNAME_MAX                            T{
     Max   number   of   bytes  supported  for  name  of  a  time
     zone
     T}
     _SC_VERSION                   _POSIX_VERSION                        T{
     POSIX.1  version  supported occurrences of a regular expres-
     sion   permitted   when   using   the   interval   notation   \{_m,_n\}
     T}
     _SC_XBS5_ILP32_OFF32
              _XBS_ILP32_OFF32                      T{
     Supports  X/Open  ILP32  w/32-bit  offset   build   environ-
     ment
     T}
     _SC_XBS5_ILP32_OFFBIG         _XBS5_ILP32_OFFBIG                    T{
     Supports  X/Open  LP32  w/64-bit   offset   build   environ-
     ment
     T}
     _SC_XBS5_LP64_OFF64           _XBS5_LP64_OFF64                      T{
     Supports    X/Open     LP64,     64-bit     offset     build



SunOS 5.7           Last change: 10 Mar 1998                    6






C Library Functions                                   sysconf(3C)



     environ-
     ment
     T}
     _SC_XBS5_LPBIG_OFFBIG         _XBS5_LP64_OFF64                      Same
     as                               _SC_XBS5_LP64_OFF64
     _SC_XOPEN_CRYPT               _XOPEN_CRYPT                          T{
     Supports          X/Open          Encryption         Feature
     Group
     T}
     _SC_XOPEN_ENH_I18N            _XOPEN_ENH_I18N                       T{
     Supports   X/Open   Enhanced   Internationalization  Feature
     Group
     T}
     _SC_XOPEN_LEGACY              _XOPEN_LEGACY                         T{
     Supports           X/Open           Legacy           Feature
     Group
     T}
     _SC_XOPEN_REALTIME            _XOPEN_REALTIME                       T{
     Supports       X/Open       POSIX      Realtime      Feature
     Group
     T}

     _SC_XOPEN_REALTIME_
        THREADS


     _XOPEN_REALTIME_
        THREADS
                                   T{
     Supports    X/Open    POSIX    Reatime    Threads    Feature
     Group
     T}
     _SC_XOPEN_SHM                 _XOPEN_SHM                            T{
     Supports       X/Open       Shared       Memory      Feature
     Group
     T}
     _SC_XOPEN_UNIX                _XOPEN_UNIX                           T{
     Supports  X/Open  CAE  Specification,  August  1994,  System
     Interfaces   and   Headers,   Issue   4,   Version   2
     T}
     _SC_XOPEN_VERSION             _XOPEN_VERSION                        T{
     Integer value indicating version of X/Open Portability Guide
     to       which       implementation       conforms
     T}
     _SC_XOPEN_XCU_VERSION         _XOPEN_XCU_VERSION
                        T{
     Integer value indicating version  of  XCU  specification  to
     which        implementation        conforms
     T}

RETURN VALUES




SunOS 5.7           Last change: 10 Mar 1998                    7






C Library Functions                                   sysconf(3C)



     Upon successful completion, 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
     implementation's <limits.h>, <unistd.h>  or  <time.h>.   The
     value  will  not  change  during the lifetime of the calling
     process.

     If _n_a_m_e is an invalid value, sysconf() returns -1  and  sets
     errno  to  indicate the error. If the variable corresponding
     to _n_a_m_e is associated with functionality that  is  not  sup-
     ported  by the system, sysconf() returns -1 without changing
     the value of _e_r_r_n_o.

     Calling      sysconf()       with       _SC_THREAD_KEYS_MAX,
     _SC_THREAD_THREADS_MAX,  or _SC_THREAD_DESTRUCTOR_ITERATIONS
     returns -1 without setting errno, because no  maximum  limit
     can  be determined. The system supports at least the minimum
     values       defined       by        _POSIX_THREAD_KEYS_MAX,
     _POSIX_THREAD_THREADS_MAX,                               and
     _POSIX_THREAD_DESTRUCTOR_ITERATIONS and can  support  higher
     values depending upon system resources.

     The following SPARC and x86 platform variables  return  EIN-
     VAL:
     _SC_COHER_BLKSZ               _SC_DCACHE_ASSOC
     _SC_DCACHE_BLKSZ              _SC_DCACHE_LINESZ
     _SC_DCACHE_SZ                 _SC_DCACHE_TBLKSZ
     _SC_ICACHE_ASSOC              _SC_ICACHE_BLKSZ
     _SC_ICACHE_LINESZ             _SC_ICACHE_SZ
     _SC_SPLIT_CACHE

ERRORS
     The sysconf() function will fail if:

     EINVAL    The value of the _n_a_m_e argument is invalid.

ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:
     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |______________________________|______________________________|
    | Architecture                | SPARC and x86               |
    |______________________________|______________________________|
    | MT-Level                    | MT-Safe, Async-Signal-Safe  |
    |______________________________|______________________________|

SEE ALSO
     fpathconf(2), seteuid(2), setrlimit(2), attributes(5), stan-
     dards(5)




SunOS 5.7           Last change: 10 Mar 1998                    8






C Library Functions                                   sysconf(3C)



NOTES
     A call to setrlimit() may cause the  value  of  OPEN_MAX  to
     change.

     Multiplying            sysconf(_SC_PHYS_PAGES)            or
     sysconf(_SC_AVPHYS_PAGES) by sysconf(_SC_PAGESIZE) to deter-
     mine memory amount in bytes can exceed  the  maximum  values
     representable in a long or unsigned long.

     The value of CLK_TCK may be variable and it  should  not  be
     assumed that CLK_TCK is a compile-time constant.

     The  _SC_PHYS_PAGES  and   _SC_AVPHYS_PAGES  variables   are
     specific to Solaris 2.3 or compatible releases.

     The  _SC_THREAD_PRIO_INHERIT   and   _SC_THREAD_PRIO_PROTECT
     variables  are  currently not supported. A call to sysconf()
     with these variables as arguments returns  -1.





































SunOS 5.7           Last change: 10 Mar 1998                    9



