2 .\" Copyright (c) 2013 Gary Mills
3 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
4 .\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
5 .\" Copyright 1989 AT&T
6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
7 .\" http://www.opengroup.org/bookstore/.
8 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 .\" This notice shall appear on any product containing this material.
10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 .TH SYSCONF 3C "Apr 16, 2013"
15 sysconf \- get configurable system variables
21 \fBlong\fR \fBsysconf\fR(\fBint\fR \fIname\fR);
27 The \fBsysconf()\fR function provides a method for an application to determine
28 the current value of a configurable system limit or option (variable).
31 The \fIname\fR argument represents the system variable to be queried. The
32 following table lists the minimal set of system variables from \fB<limits.h>\fR
33 and \fB<unistd.h>\fR that can be returned by \fBsysconf()\fR and the symbolic
34 constants defined in \fB<unistd.h>\fR that are the corresponding values used
35 for \fIname\fR on the SPARC and x86 platforms.
39 Name Return Value Meaning
40 _______________________________________________________________________
41 _SC_2_C_BIND _POSIX2_C_BIND Supports the C lang-
43 _SC_2_C_DEV _POSIX2_C_DEV Supports the C lang-
46 _SC_2_C_VERSION _POSIX2_C_VERSION Integer value
50 _SC_2_CHAR_TERM _POSIX2_CHAR_TERM Supports at least
52 _SC_2_FORT_DEV _POSIX2_FORT_DEV Supports FORTRAN
55 _SC_2_FORT_RUN _POSIX2_FORT_RUN Supports FORTRAN
58 _SC_2_LOCALEDEF _POSIX2_LOCALEDEF Supports creation
61 _SC_2_SW_DEV _POSIX2_SW_DEV Supports Software
64 _SC_2_UPE _POSIX2_UPE Supports User
67 _SC_2_VERSION _POSIX2_VERSION Integer value
72 _SC_AIO_LISTIO_MAX AIO_LISTIO_MAX Max number of I/O
76 _SC_AIO_MAX AIO_MAX Max number of
80 _SC_AIO_PRIO_DELTA_MAX AIO_PRIO_DELTA_MAX Max amount by which
86 _SC_ARG_MAX ARG_MAX Max size of argv[]
88 _SC_ASYNCHRONOUS_IO _POSIX_ASYNCHRONOUS_IO Supports
90 _SC_ATEXIT_MAX ATEXIT_MAX Max number of
94 _SC_AVPHYS_PAGES Number of physical
98 _SC_BARRIERS _POSIX_BARRIERS Supports Barriers
100 _SC_BC_BASE_MAX BC_BASE_MAX Maximum obase values
102 _SC_BC_DIM_MAX BC_DIM_MAX Max number of
105 _SC_BC_SCALE_MAX BC_SCALE_MAX Max scale value
107 _SC_BC_STRING_MAX BC_STRING_MAX Max length of string
110 _SC_CHILD_MAX CHILD_MAX Max processes
112 _SC_CLK_TCK CLK_TCK Ticks per second
114 _SC_CLOCK_SELECTION _POSIX_CLOCK_SELECTION Supports Clock
116 _SC_COLL_WEIGHTS_MAX COLL_WEIGHTS_MAX Max number of
122 _SC_CPUID_MAX Max possible
124 _SC_DELAYTIMER_MAX DELAYTIMER_MAX Max number of timer
126 _SC_EXPR_NEST_MAX EXPR_NEST_MAX Max number of
128 _SC_FSYNC _POSIX_FSYNC Supports File
130 _SC_GETGR_R_SIZE_MAX Max size of group
132 _SC_GETPW_R_SIZE_MAX Max size of password
134 _SC_HOST_NAME_MAX _POSIX_HOST_NAME_MAX Maximum length of a
137 _SC_IOV_MAX IOV_MAX Max number of iovec
142 _SC_JOB_CONTROL _POSIX_JOB_CONTROL Job control
144 _SC_LINE_MAX LINE_MAX Max length of input
146 _SC_LOGIN_NAME_MAX LOGIN_NAME_MAX Max length of login
148 _SC_LOGNAME_MAX LOGNAME_MAX
149 _SC_MAPPED_FILES _POSIX_MAPPED_FILES Supports Memory
151 _SC_MAXPID Max pid value
152 _SC_MEMLOCK _POSIX_MEMLOCK Supports Process
154 _SC_MEMLOCK_RANGE _POSIX_MEMLOCK_RANGE Supports Range
156 _SC_MEMORY_PROTECTION _POSIX_MEMORY_PROTECTION Supports Memory
158 _SC_MESSAGE_PASSING _POSIX_MESSAGE_PASSING Supports Message
160 _SC_MONOTONIC_CLOCK _POSIX_MONOTONIC_CLOCK Supports Monotonic
162 _SC_MQ_OPEN_MAX MQ_OPEN_MAX Max number of open
165 _SC_MQ_PRIO_MAX MQ_PRIO_MAX Max number of
168 _SC_NGROUPS_MAX NGROUPS_MAX Max simultaneous
171 _SC_NPROCESSORS_CONF Number of processors
173 _SC_NPROCESSORS_MAX Max number of
176 _SC_NPROCESSORS_ONLN Number of processors
178 _SC_OPEN_MAX OPEN_MAX Max open files per
180 _SC_PAGESIZE PAGESIZE System memory page
182 _SC_PAGE_SIZE PAGESIZE Same as _SC_PAGESIZE
183 _SC_PASS_MAX PASS_MAX Max number of
186 _SC_PHYS_PAGES Total number of
189 _SC_PRIORITIZED_IO _POSIX_PRIORITIZED_IO Supports Prioritized
191 _SC_PRIORITY_SCHEDULING _POSIX_PRIORITY_SCHEDULING Supports Process
193 _SC_RAW_SOCKETS _POSIX_RAW_SOCKETS Supports Raw Sockets
195 _SC_RE_DUP_MAX RE_DUP_MAX Max number of
201 _SC_READER_WRITER_LOCKS _POSIX_READER_WRITER_LOCKS Supports IPV6 option
202 _SC_REALTIME_SIGNALS _POSIX_REALTIME_SIGNALS Supports Realtime
204 _SC_REGEXP _POSIX_REGEXP Supports Regular
207 _SC_RTSIG_MAX RTSIG_MAX Max number of
211 _SC_SAVED_IDS _POSIX_SAVED_IDS Saved IDs
214 _SC_SEM_NSEMS_MAX SEM_NSEMS_MAX Max number of POSIX
217 _SC_SEM_VALUE_MAX SEM_VALUE_MAX Max value a POSIX
219 _SC_SEMAPHORES _POSIX_SEMAPHORES Supports Semaphores
220 _SC_SHARED_MEMORY_ _POSIX_SHARED_MEMORY_ Supports Shared
221 OBJECTS OBJECTS Memory Objects
222 _SC_SHELL _POSIX_SHELL Supports POSIX shell
223 _SC_SIGQUEUE_MAX SIGQUEUE_MAX Max number of queued
229 _SC_SPAWN _POSIX_SPAWN Supports Spawn option
230 _SC_SPIN_LOCKS _POSIX_SPIN_LOCKS Supports Spin Locks
232 _SC_STACK_PROT Default stack
234 _SC_STREAM_MAX STREAM_MAX Number of streams
237 _SC_SYMLOOP_MAX _POSIX_SYMLOOP_MAX Max number of symbolic
239 reliably traversed in
241 pathname in the absence
243 _SC_SYNCHRONIZED_IO _POSIX_SYNCHRONIZED_IO Supports
245 _SC_THREAD_ATTR_ _POSIX_THREAD_ATTR_ Supports Thread
246 STACKADDR STACKADDR Stack Address
248 _SC_THREAD_ATTR_ _POSIX_THREAD_ATTR_ Supports Thread
249 STACKSIZE STACKSIZE Stack Size
251 _SC_THREAD_DESTRUCTOR_ PTHREAD_DESTRUCTOR_ Number attempts made
252 ITERATIONS ITERATIONS to destroy thread-
255 _SC_THREAD_KEYS_MAX PTHREAD_KEYS_MAX Max number of data
257 _SC_THREAD_PRIO_ _POSIX_THREAD_PRIO_ Supports Priority
258 INHERIT INHERIT Inheritance option
259 _SC_THREAD_PRIO_ _POSIX_THREAD_PRIO_ Supports Priority
260 PROTECT PROTECT Protection option
261 _SC_THREAD_PRIORITY_ _POSIX_THREAD_PRIORITY_ Supports Thread
262 SCHEDULING SCHEDULING Execution
264 _SC_THREAD_PROCESS_ _POSIX_THREAD_PROCESS_ Supports
265 SHARED SHARED Process-Shared
268 _SC_THREAD_SAFE_ _POSIX_THREAD_SAFE_ Supports Thread-Safe
269 FUNCTIONS FUNCTIONS Functions option
270 _SC_THREAD_STACK_MIN PTHREAD_STACK_MIN Min byte size of
272 _SC_THREAD_THREADS_MAX PTHREAD_THREADS_MAX Max number of
274 _SC_THREADS _POSIX_THREADS Supports Threads
276 _SC_TIMEOUTS _POSIX_TIMEOUTS Supports Timeouts
278 _SC_TIMER_MAX TIMER_MAX Max number of timer
281 _SC_TIMERS _POSIX_TIMERS Supports Timers
282 _SC_TTY_NAME_MAX TTYNAME_MAX Max length of tty
284 _SC_TZNAME_MAX TZNAME_MAX Max number of bytes
287 _SC_V6_ILP32_OFF32 _POSIX_V6_ILP32_OFF32 Supports X/Open
291 _SC_V6_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG Supports X/Open
295 _SC_V6_LP64_OFF64 _POSIX_V6_LP64_OFF64 Supports X/Open
299 _SC_V6_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG Same as
301 _SC_VERSION _POSIX_VERSION POSIX.1 version
303 _SC_XBS5_ILP32_OFF32 _XBS_ILP32_OFF32 Indicates support
307 _SC_XBS5_ILP32_OFFBIG _XBS5_ILP32_OFFBIG Indicates support
311 _SC_XBS5_LP64_OFF64 _XBS5_LP64_OFF64 Indicates support of
315 _SC_XBS5_LPBIG_OFFBIG _XBS5_LP64_OFF64 Same as
317 _SC_XOPEN_CRYPT _XOPEN_CRYPT Supports X/Open
320 _SC_XOPEN_ENH_I18N _XOPEN_ENH_I18N Supports X/Open
324 _SC_XOPEN_LEGACY _XOPEN_LEGACY Supports X/Open
326 _SC_XOPEN_REALTIME _XOPEN_REALTIME Supports X/Open
329 _SC_XOPEN_REALTIME_ _XOPEN_REALTIME_THREADS Supports X/Open
330 THREADS POSIX Reatime
333 _SC_XOPEN_SHM _XOPEN_SHM Supports X/Open
336 _SC_XOPEN_STREAMS _POSIX_XOPEN_STREAMS Supports XSI Streams
338 _SC_XOPEN_UNIX _XOPEN_UNIX Supports X/Open CAE
344 _SC_XOPEN_VERSION _XOPEN_VERSION Integer value
350 _SC_XOPEN_XCU_VERSION _XOPEN_XCU_VERSION Integer value
361 The following options are not supported and return \(mi1:
368 \fB_SC_2_PBS\fR \fB_POSIX2_PBS\fR
369 \fB_SC_2_PBS_ACCOUNTING\fR \fB_POSIX2_PBS_ACCOUNTING\fR
370 \fB_SC_2_PBS_CHECKPOINT\fR \fB_POSIX2_PBS_CHECKPOINT\fR
371 \fB_SC_2_PBS_LOCATE\fR \fB_POSIX2_PBS_LOCATE\fR
372 \fB_SC_2_PBS_MESSAGE\fR \fB_POSIX2_PBS_MESSAGE\fR
373 \fB_SC_2_PBS_TRACK\fR \fB_POSIX2_PBS_TRACK\fR
374 \fB_SC_ADVISORY_INFO\fR \fB_POSIX_ADVISORY_INFO\fR
375 \fB_SC_CPUTIME\fR \fB_POSIX_CPUTIME\fR
376 \fB_SC_SPORADIC_SERVER\fR \fB_POSIX_SPORADIC_SERVER\fR
377 \fB_SC_SS_REPL_MAX\fR \fB_POSIX_SS_REPL_MAX\fR
378 \fB_SC_THREAD_CPUTIME\fR \fB_POSIX_THREAD_CPUTIME\fR
379 \fB_SC_THREAD_SPORADIC_SERVER\fR \fB_POSIX_THREAD_SPORADIC_SERVER\fR
380 \fB_SC_TRACE\fR \fB_POSIX_TRACE\fR
381 \fB_SC_TRACE_EVENT_FILTER\fR \fB_POSIX_TRACE_EVENT_FILTER\fR
382 \fB_SC_TRACE_EVENT_NAME_MAX\fR \fB_POSIX_TRACE_EVENT_NAME_MAX\fR
383 \fB_SC_TRACE_INHERIT\fR \fB_POSIX_TRACE_INHERIT\fR
384 \fB_SC_TRACE_LOG\fR \fB_POSIX_TRACE_LOG\fR
385 \fB_SC_TRACE_NAME_MAX\fR \fB_POSIX_TRACE_NAME_MAX\fR
386 \fB_SC_TRACE_SYS_MAX\fR \fB_POSIX_TRACE_SYS_MAX\fR
387 \fB_SC_TRACE_USER_EVENT_MAX\fR \fB_POSIX_TRACE_USER_EVENT_MAX\fR
388 \fB_SC_TYPED_MEMORY_OBJECTS\fR \fB_POSIX_TYPED_MEMORY_OBJECTS\fR
394 Upon successful completion, \fBsysconf()\fR returns the current variable value
395 on the system. The value returned will not be more restrictive than the
396 corresponding value described to the application when it was compiled with the
397 implementation's <\fBlimits.h\fR>, <\fBunistd.h\fR> or <\fBtime.h\fR>. With
398 only a few obvious exceptions such as \fB_SC_AVPHYS_PAGES\fR and
399 \fB_SC_NPROCESSORS_ONLN\fR, the value will not change during the lifetime of
403 If \fIname\fR is an invalid value, \fBsysconf()\fR returns \fB\(mi1\fR and sets
404 \fBerrno\fR to indicate the error. If the variable corresponding to \fIname\fR
405 is associated with functionality that is not supported by the system,
406 \fBsysconf()\fR returns \fB\(mi1\fR without changing the value of \fIerrno\fR.
409 Calling \fBsysconf()\fR with the following returns \fB\(mi1\fR without setting
410 \fBerrno\fR, because no maximum limit can be determined. The system supports at
411 least the minimum values and can support higher values depending upon system
416 Variable Minimum supported value
417 _SC_AIO_MAX _POSIX_AIO_MAX
420 _SC_THREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
421 _SC_THREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
422 _SC_THREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
428 The following SPARC and x86 platform variables return \fBEINVAL\fR:
432 _SC_COHER_BLKSZ _SC_DCACHE_ASSOC
433 _SC_DCACHE_BLKSZ _SC_DCACHE_LINESZ
434 _SC_DCACHE_SZ _SC_DCACHE_TBLKSZ
435 _SC_ICACHE_ASSOC _SC_ICACHE_BLKSZ
436 _SC_ICACHE_LINESZ _SC_ICACHE_SZ
444 The \fBsysconf()\fR function will fail if:
451 The value of the \fIname\fR argument is invalid.
457 See \fBattributes\fR(5) for descriptions of the following attributes:
465 ATTRIBUTE TYPE ATTRIBUTE VALUE
467 Architecture SPARC and x86
469 Interface Stability Committed
471 MT-Level MT-Safe, Async-Signal-Safe
473 Standard See \fBstandards\fR(5).
479 \fBpooladm\fR(1M), \fBzoneadm\fR(1M), \fBfpathconf\fR(2), \fBseteuid\fR(2),
480 \fBsetrlimit\fR(2), \fBconfstr\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
484 A call to \fBsetrlimit()\fR can cause the value of \fBOPEN_MAX\fR to change.
487 Multiplying \fBsysconf\fR(\fB_SC_PHYS_PAGES\fR) or
488 \fBsysconf\fR(\fB_SC_AVPHYS_PAGES\fR) by \fBsysconf\fR(\fB_SC_PAGESIZE\fR) to
489 determine memory amount in bytes can exceed the maximum values representable in
490 a 32-bit signed or unsigned integer.
493 The value of \fBCLK_TCK\fR can be variable and it should not be assumed that
494 \fBCLK_TCK\fR is a compile-time constant.
497 If the caller is in a non-global zone and the pools facility is active,
498 \fBsysconf\fR(\fB_SC_NPROCESSORS_CONF\fR) and
499 \fBsysconf\fR(\fB_SC_NPROCESSORS_ONLN\fR) return the number of processors in
500 the processor set of the pool to which the zone is bound.