Standard C Library Functions sysconf(3C)
NAME
sysconf - get configurable system variables
SYNOPSIS
#include
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 name argument represents the system variable to be
queried. The following table lists the minimal set of system
variables from and that can be
returned by sysconf() and the symbolic constants defined in
that are the corresponding values used for name
on the SPARC and x86 platforms.
Name Return Value Meaning
SC2CBIND POSIX2CBIND Supports the C lang-
uage binding option
SC2CDEV POSIX2CDEV Supports the C lang-
uage development
utilities option
SC2CVERSION POSIX2CVERSION Integer value
indicates version
of ISO POSIX-2
standard (Commands)
SC2CHARTERM POSIX2CHARTERM Supports at least
one terminal
SC2FORTDEV POSIX2FORTDEV Supports FORTRAN
Development
Utilities Option
SC2FORTRUN POSIX2FORTRUN Supports FORTRAN
Run-time Utilities
Option
SC2LOCALEDEF POSIX2LOCALEDEF Supports creation
of locales by the
localedef utility
SC2SWDEV POSIX2SWDEV Supports Software
Development Utility
Option
SC2UPE POSIX2UPE Supports User
Portability
Utilities Option
SC2VERSION POSIX2VERSION Integer value
indicates version
SunOS 5.11 Last change: 26 Mar 2008 1
Standard C Library Functions sysconf(3C)
of ISO POSIX-2
standard (C language
binding)
SCAIOLISTIOMAX AIOLISTIOMAX Max number of I/O
operations in a
single list I/O call
supported
SCAIOMAX AIOMAX Max number of
outstanding
asynchronous I/O
operations supported
SCAIOPRIODELTAMAX AIOPRIODELTAMAX Max amount by which
process can decrease
its asynchronous
I/O priority level
from its own
scheduling priority
SCARGMAX ARGMAX Max size of argv[]
plus envp[]
SCASYNCHRONOUSIO POSIXASYNCHRONOUSIO Supports
Asynchronous I/O
SCATEXITMAX ATEXITMAX Max number of
functions that can
be registered with
atexit()
SCAVPHYSPAGES Number of physical
memory pages not
currently in use by
system
SCBARIERS POSIXBARIERS Supports Barriers
option
SCBCBASEMAX BCBASEMAX Maximum obase values
allowed by bc
SCBCDIMAX BCDIMAX Max number of
elements permitted
in array by bc
SCBCSCALEMAX BCSCALEMAX Max scale value
allowed by bc
SCBCSTRINGMAX BCSTRINGMAX Max length of string
constant allowed by
bc
SCHILDMAX CHILDMAX Max processes
allowed to a UID
SCLKTCK CLKTCK Ticks per second
(clockt)
SCLOCKSELECTION POSIXCLOCKSELECTION Supports Clock
Selection option
SCOLWEIGHTSMAX COLWEIGHTSMAX Max number of
weights that can be
assigned to entry of
the LCOLATE order
keyword in locale
SunOS 5.11 Last change: 26 Mar 2008 2
Standard C Library Functions sysconf(3C)
definition file
SCPUIDMAX Max possible
processor ID
SCDELAYTIMERMAX DELAYTIMERMAX Max number of timer
expiration overruns
SCEXPRNESTMAX EXPRNESTMAX Max number of
parentheses by expr
SCFSYNC POSIXFSYNC Supports File
Synchronization
SCGETGRSIZEMAX Max size of group
entry buffer
SCGETPWRSIZEMAX Max size of password
entry buffer
SCHOSTNAMEMAX POSIXHOSTNAMEMAX Maximum length of a
host name (excluding
terminating null)
SCIOVMAX IOVMAX Max number of iovec
structures available
to one process for
use with readv()
and writev()
SCJOBCONTROL POSIXJOBCONTROL Job control
supported?
SCLINEMAX LINEMAX Max length of input
line
SCLOGINAMEMAX LOGNAMEMAX ] 1 Max length of login
name
SCLOGNAMEMAX LOGNAMEMAX
SCMAPEDFILES POSIXMAPEDFILES Supports Memory
Mapped Files
SCMAXPID Max pid value
SCMEMLOCK POSIXMEMLOCK Supports Process
Memory Locking
SCMEMLOCKRANGE POSIXMEMLOCKRANGE Supports Range
Memory Locking
SCMEMORYPROTECTION POSIXMEMORYPROTECTION Supports Memory
Protection
SCMESAGEPASING POSIXMESAGEPASING Supports Message
Passing
SCMONOTONICLOCK POSIXMONOTONICLOCK Supports Monotonic
Clock option
SCMQOPENMAX MQOPENMAX Max number of open
message queues a
process can hold
SCMQPRIOMAX MQPRIOMAX Max number of
message priorities
supported
SCNGROUPSMAX NGROUPSMAX Max simultaneous
groups to which
one can belong
SCNPROCESORSCONF Number of processors
configured
SunOS 5.11 Last change: 26 Mar 2008 3
Standard C Library Functions sysconf(3C)
SCNPROCESORSMAX Max number of
processors supported
by platform
SCNPROCESORSONLN Number of processors
online
SCOPENMAX OPENMAX Max open files per
process
SCPAGESIZE PAGESIZE System memory page
size
SCPAGESIZE PAGESIZE Same as SCPAGESIZE
SCPASMAX PASMAX Max number of
significant bytes
in a password
SCPHYSPAGES Total number of
pages of physical
memory in system
SCPRIORITIZEDIO POSIXPRIORITIZEDIO Supports Prioritized
I/O
SCPRIORITYSCHEDULING POSIXPRIORITYSCHEDULING Supports Process
Scheduling
SCRAWSOCKETS POSIXRAWSOCKETS Supports Raw Sockets
option
SCREDUPMAX REDUPMAX Max number of
repeated occurrences
of a regular
expression permitted
when using interval
notation \{m,n\}
SCREADERWRITERLOCKS POSIXREADERWRITERLOCKS Supports IPV6 option
SCREALTIMESIGNALS POSIXREALTIMESIGNALS Supports Realtime
Signals
SCREGEXP POSIXREGEXP Supports Regular
Expression Handling
option
SCRTSIGMAX RTSIGMAX Max number of
realtime signals
reserved for
application use
SCSAVEDIDS POSIXSAVEDIDS Saved IDs
(seteuid())
supported?
SCSEMNSEMSMAX SEMNSEMSMAX Max number of POSIX
semaphores a process
can have
SCSEMVALUEMAX SEMVALUEMAX Max value a POSIX
semaphore can have
SCSEMAPHORES POSIXSEMAPHORES Supports Semaphores
SCSHAREDMEMORY POSIXSHAREDMEMORY Supports Shared
OBJECTS OBJECTS Memory Objects
SCSHEL POSIXSHEL Supports POSIX shell
SCSIGQUEUEMAX SIGQUEUEMAX Max number of queued
signals that a
SunOS 5.11 Last change: 26 Mar 2008 4
Standard C Library Functions sysconf(3C)
process can send and
have pending at
receiver(s) at a
time
SCSPAWN POSIXSPAWN Supports Spawn option
SCSPINLOCKS POSIXSPINLOCKS Supports Spin Locks
option
SCSTACKPROT Default stack
protection
SCSTREAMAX STREAMAX Number of streams
one process can
have open at a time
SCSYMLOPMAX POSIXSYMLOPMAX Max number of symbolic
links that can be
reliably traversed in
the resolution of a
pathname in the absence
of a loop
SCSYNCHRONIZEDIO POSIXSYNCHRONIZEDIO Supports
Synchronized I/O
SCTHREADATR POSIXTHREADATR Supports Thread
STACKADR STACKADR Stack Address
Attribute option
SCTHREADATR POSIXTHREADATR Supports Thread
STACKSIZE STACKSIZE Stack Size
Attribute option
SCTHREADESTRUCTOR PTHREADESTRUCTOR Number attempts made
ITERATIONS ITERATIONS to destroy thread-
specific data on
thread exit
SCTHREADKEYSMAX PTHREADKEYSMAX Max number of data
keys per process
SCTHREADPRIO POSIXTHREADPRIO Supports Priority
INHERIT INHERIT Inheritance option
SCTHREADPRIO POSIXTHREADPRIO Supports Priority
PROTECT PROTECT Protection option
SCTHREADPRIORITY POSIXTHREADPRIORITY Supports Thread
SCHEDULING SCHEDULING Execution
Scheduling option
SCTHREADPROCES POSIXTHREADPROCES Supports
SHARED SHARED Process-Shared
Synchronization
option
SCTHREADSAFE POSIXTHREADSAFE Supports Thread-Safe
FUNCTIONS FUNCTIONS Functions option
SCTHREADSTACKMIN PTHREADSTACKMIN Min byte size of
thread stack storage
SCTHREADTHREADSMAX PTHREADTHREADSMAX Max number of
threads per process
SCTHREADS POSIXTHREADS Supports Threads
option
SCTIMEOUTS POSIXTIMEOUTS Supports Timeouts
SunOS 5.11 Last change: 26 Mar 2008 5
Standard C Library Functions sysconf(3C)
option
SCTIMERMAX TIMERMAX Max number of timer
per process
supported
SCTIMERS POSIXTIMERS Supports Timers
SCTYNAMEMAX TYNAMEMAX Max length of tty
device name
SCTZNAMEMAX TZNAMEMAX Max number of bytes
supported for name
of a time zone
SCV6ILP32OF32 POSIXV6ILP32OF32 Supports X/Open
ILP32 w/32-bit
offset build
environment
SCV6ILP32OFBIG POSIXV6ILP32OFBIG Supports X/Open
ILP32 w/64-bit
offset build
environment
SCV6LP64OF64 POSIXV6LP64OF64 Supports X/Open
LP64 w/64-bit
offset build
environment
SCV6LPBIGOFBIG POSIXV6LPBIGOFBIG Same as
SCV6LP64OF64
SCVERSION POSIXVERSION POSIX.1 version
supported
SCXBS5ILP32OF32 XBSILP32OF32 Indicates support
for X/Open ILP32
w/32-bit offset
build environment
SCXBS5ILP32OFBIG XBS5ILP32OFBIG Indicates support
for X/Open ILP32
w/64-bit offset
build environment
SCXBS5LP64OF64 XBS5LP64OF64 Indicates support of
X/Open LP64,
64-bit offset
build environment
SCXBS5LPBIGOFBIG XBS5LP64OF64 Same as
SCXBS5LP64OF64
SCXOPENCRYPT XOPENCRYPT Supports X/Open
Encryption Feature
Group
SCXOPENENHI18N XOPENENHI18N Supports X/Open
Enhanced
Internationalization
Feature Group
SCXOPENLEGACY XOPENLEGACY Supports X/Open
Legacy Feature Group
SCXOPENREALTIME XOPENREALTIME Supports X/Open
POSIX Realtime
Feature Group
SunOS 5.11 Last change: 26 Mar 2008 6
Standard C Library Functions sysconf(3C)
SCXOPENREALTIME XOPENREALTIMETHREADS Supports X/Open
THREADS POSIX Reatime
Threads Feature
Group
SCXOPENSHM XOPENSHM Supports X/Open
Shared Memory
Feature Group
SCXOPENSTREAMS POSIXOPENSTREAMS Supports XSI Streams
option group
SCXOPENUNIX XOPENUNIX Supports X/Open CAE
Specification,
August 1994, System
Interfaces and
Headers, Issue 4,
Version 2
SCXOPENVERSION XOPENVERSION Integer value
indicates version of
X/Open Portability
Guide to which
implementation
conforms
SCXOPENXCUVERSION XOPENXCUVERSION Integer value
indicates version of
XCU specification to
which implementation
conforms
The following options are not supported and return -1:
SC2PBS POSIX2PBS
SC2PBSACOUNTING POSIX2PBSACOUNTING
SC2PBSCHECKPOINT POSIX2PBSCHECKPOINT
SC2PBSLOCATE POSIX2PBSLOCATE
SC2PBSMESAGE POSIX2PBSMESAGE
SC2PBSTRACK POSIX2PBSTRACK
SCADVISORYINFO POSIXADVISORYINFO
SCPUTIME POSIXCPUTIME
SCSPORADICSERVER POSIXSPORADICSERVER
SCSREPLMAX POSIXSREPLMAX
SCTHREADCPUTIME POSIXTHREADCPUTIME
SCTHREADSPORADICSERVER POSIXTHREADSPORADICSERVER
SCTRACE POSIXTRACE
SCTRACEVENTFILTER POSIXTRACEVENTFILTER
SCTRACEVENTNAMEMAX POSIXTRACEVENTNAMEMAX
SCTRACEINHERIT POSIXTRACEINHERIT
SCTRACELOG POSIXTRACELOG
SCTRACENAMEMAX POSIXTRACENAMEMAX
SunOS 5.11 Last change: 26 Mar 2008 7
Standard C Library Functions sysconf(3C)
SCTRACESYSMAX POSIXTRACESYSMAX
SCTRACEUSEREVENTMAX POSIXTRACEUSEREVENTMAX
SCTYPEDMEMORYOBJECTS POSIXTYPEDMEMORYOBJECTS
RETURN VALUES
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 , or . With
only a few obvious exceptions such as SCAVPHYSPAGES and
SCNPROCESORSONLN, the value will not change during the
lifetime of the calling process.
If name is an invalid value, sysconf() returns -1 and sets
errno to indicate the error. If the variable corresponding
to name is associated with functionality that is not sup-
ported by the system, sysconf() returns -1 without changing
the value of errno.
Calling sysconf() with the following returns -1 without set-
ting errno, because no maximum limit can be determined. The
system supports at least the minimum values and can support
higher values depending upon system resources.
Variable Minimum supported value
SCAIOMAX POSIXAIOMAX
SCATEXITMAX 32
SCMQOPENMAX 32
SCTHREADTHREADSMAX POSIXTHREADTHREADSMAX
SCTHREADKEYSMAX POSIXTHREADKEYSMAX
SCTHREADESTRUCTORITERATIONS POSIXTHREADESTRUCTORITERATIONS
The following SPARC and x86 platform variables return EIN-
VAL:
SCOHERBLKSZ SCDCACHEASOC
SCDCACHEBLKSZ SCDCACHELINESZ
SCDCACHESZ SCDCACHETBLKSZ
SCICACHEASOC SCICACHEBLKSZ
SCICACHELINESZ SCICACHESZ
SCSPLITCACHE
ERORS
The sysconf() function will fail if:
SunOS 5.11 Last change: 26 Mar 2008 8
Standard C Library Functions sysconf(3C)
EINVAL The value of the name argument is invalid.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Architecture SPARC and x86
Interface Stability Committed
MT-Level MT-Safe, Async-Signal-Safe
Standard See standards(5).
SEE ALSO
pooladm(1M), zoneadm(1M), fpathconf(2), seteuid(2),
setrlimit(2), confstr(3C), attributes(5), standards(5)
NOTES
A call to setrlimit() can cause the value of OPENMAX to
change.
Multiplying sysconf(SCPHYSPAGES) or
sysconf(SCAVPHYSPAGES) by sysconf(SCPAGESIZE) to deter-
mine memory amount in bytes can exceed the maximum values
representable in a 32-bit signed or unsigned integer.
The value of CLKTCK can be variable and it should not be
assumed that CLKTCK is a compile-time constant.
If the caller is in a non-global zone and the pools facility
is active, sysconf(SCNPROCESORSCONF) and
sysconf(SCNPROCESORSONLN) return the number of proces-
sors in the processor set of the pool to which the zone is
bound.
SunOS 5.11 Last change: 26 Mar 2008 9
|