2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
45 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
46 .\" Copyright (c) 2013 Gary Mills
48 .TH SYSCONF 3C "Apr 16, 2013"
50 sysconf \- get configurable system variables
56 \fBlong\fR \fBsysconf\fR(\fBint\fR \fIname\fR);
62 The \fBsysconf()\fR function provides a method for an application to determine
63 the current value of a configurable system limit or option (variable).
66 The \fIname\fR argument represents the system variable to be queried. The
67 following table lists the minimal set of system variables from \fB<limits.h>\fR
68 and \fB<unistd.h>\fR that can be returned by \fBsysconf()\fR and the symbolic
69 constants defined in \fB<unistd.h>\fR that are the corresponding values used
70 for \fIname\fR on the SPARC and x86 platforms.
74 Name Return Value Meaning
75 _______________________________________________________________________
76 _SC_2_C_BIND _POSIX2_C_BIND Supports the C lang-
78 _SC_2_C_DEV _POSIX2_C_DEV Supports the C lang-
81 _SC_2_C_VERSION _POSIX2_C_VERSION Integer value
85 _SC_2_CHAR_TERM _POSIX2_CHAR_TERM Supports at least
87 _SC_2_FORT_DEV _POSIX2_FORT_DEV Supports FORTRAN
90 _SC_2_FORT_RUN _POSIX2_FORT_RUN Supports FORTRAN
93 _SC_2_LOCALEDEF _POSIX2_LOCALEDEF Supports creation
96 _SC_2_SW_DEV _POSIX2_SW_DEV Supports Software
99 _SC_2_UPE _POSIX2_UPE Supports User
102 _SC_2_VERSION _POSIX2_VERSION Integer value
107 _SC_AIO_LISTIO_MAX AIO_LISTIO_MAX Max number of I/O
111 _SC_AIO_MAX AIO_MAX Max number of
115 _SC_AIO_PRIO_DELTA_MAX AIO_PRIO_DELTA_MAX Max amount by which
121 _SC_ARG_MAX ARG_MAX Max size of argv[]
123 _SC_ASYNCHRONOUS_IO _POSIX_ASYNCHRONOUS_IO Supports
125 _SC_ATEXIT_MAX ATEXIT_MAX Max number of
129 _SC_AVPHYS_PAGES Number of physical
133 _SC_BARRIERS _POSIX_BARRIERS Supports Barriers
135 _SC_BC_BASE_MAX BC_BASE_MAX Maximum obase values
137 _SC_BC_DIM_MAX BC_DIM_MAX Max number of
140 _SC_BC_SCALE_MAX BC_SCALE_MAX Max scale value
142 _SC_BC_STRING_MAX BC_STRING_MAX Max length of string
145 _SC_CHILD_MAX CHILD_MAX Max processes
147 _SC_CLK_TCK CLK_TCK Ticks per second
149 _SC_CLOCK_SELECTION _POSIX_CLOCK_SELECTION Supports Clock
151 _SC_COLL_WEIGHTS_MAX COLL_WEIGHTS_MAX Max number of
157 _SC_CPUID_MAX Max possible
159 _SC_DELAYTIMER_MAX DELAYTIMER_MAX Max number of timer
161 _SC_EXPR_NEST_MAX EXPR_NEST_MAX Max number of
163 _SC_FSYNC _POSIX_FSYNC Supports File
165 _SC_GETGR_R_SIZE_MAX Max size of group
167 _SC_GETPW_R_SIZE_MAX Max size of password
169 _SC_HOST_NAME_MAX _POSIX_HOST_NAME_MAX Maximum length of a
172 _SC_IOV_MAX IOV_MAX Max number of iovec
177 _SC_JOB_CONTROL _POSIX_JOB_CONTROL Job control
179 _SC_LINE_MAX LINE_MAX Max length of input
181 _SC_LOGIN_NAME_MAX LOGIN_NAME_MAX Max length of login
183 _SC_LOGNAME_MAX LOGNAME_MAX
184 _SC_MAPPED_FILES _POSIX_MAPPED_FILES Supports Memory
186 _SC_MAXPID Max pid value
187 _SC_MEMLOCK _POSIX_MEMLOCK Supports Process
189 _SC_MEMLOCK_RANGE _POSIX_MEMLOCK_RANGE Supports Range
191 _SC_MEMORY_PROTECTION _POSIX_MEMORY_PROTECTION Supports Memory
193 _SC_MESSAGE_PASSING _POSIX_MESSAGE_PASSING Supports Message
195 _SC_MONOTONIC_CLOCK _POSIX_MONOTONIC_CLOCK Supports Monotonic
197 _SC_MQ_OPEN_MAX MQ_OPEN_MAX Max number of open
200 _SC_MQ_PRIO_MAX MQ_PRIO_MAX Max number of
203 _SC_NGROUPS_MAX NGROUPS_MAX Max simultaneous
206 _SC_NPROCESSORS_CONF Number of processors
208 _SC_NPROCESSORS_MAX Max number of
211 _SC_NPROCESSORS_ONLN Number of processors
213 _SC_OPEN_MAX OPEN_MAX Max open files per
215 _SC_PAGESIZE PAGESIZE System memory page
217 _SC_PAGE_SIZE PAGESIZE Same as _SC_PAGESIZE
218 _SC_PASS_MAX PASS_MAX Max number of
221 _SC_PHYS_PAGES Total number of
224 _SC_PRIORITIZED_IO _POSIX_PRIORITIZED_IO Supports Prioritized
226 _SC_PRIORITY_SCHEDULING _POSIX_PRIORITY_SCHEDULING Supports Process
228 _SC_RAW_SOCKETS _POSIX_RAW_SOCKETS Supports Raw Sockets
230 _SC_RE_DUP_MAX RE_DUP_MAX Max number of
236 _SC_READER_WRITER_LOCKS _POSIX_READER_WRITER_LOCKS Supports IPV6 option
237 _SC_REALTIME_SIGNALS _POSIX_REALTIME_SIGNALS Supports Realtime
239 _SC_REGEXP _POSIX_REGEXP Supports Regular
242 _SC_RTSIG_MAX RTSIG_MAX Max number of
246 _SC_SAVED_IDS _POSIX_SAVED_IDS Saved IDs
249 _SC_SEM_NSEMS_MAX SEM_NSEMS_MAX Max number of POSIX
252 _SC_SEM_VALUE_MAX SEM_VALUE_MAX Max value a POSIX
254 _SC_SEMAPHORES _POSIX_SEMAPHORES Supports Semaphores
255 _SC_SHARED_MEMORY_ _POSIX_SHARED_MEMORY_ Supports Shared
256 OBJECTS OBJECTS Memory Objects
257 _SC_SHELL _POSIX_SHELL Supports POSIX shell
258 _SC_SIGQUEUE_MAX SIGQUEUE_MAX Max number of queued
264 _SC_SPAWN _POSIX_SPAWN Supports Spawn option
265 _SC_SPIN_LOCKS _POSIX_SPIN_LOCKS Supports Spin Locks
267 _SC_STACK_PROT Default stack
269 _SC_STREAM_MAX STREAM_MAX Number of streams
272 _SC_SYMLOOP_MAX _POSIX_SYMLOOP_MAX Max number of symbolic
274 reliably traversed in
276 pathname in the absence
278 _SC_SYNCHRONIZED_IO _POSIX_SYNCHRONIZED_IO Supports
280 _SC_THREAD_ATTR_ _POSIX_THREAD_ATTR_ Supports Thread
281 STACKADDR STACKADDR Stack Address
283 _SC_THREAD_ATTR_ _POSIX_THREAD_ATTR_ Supports Thread
284 STACKSIZE STACKSIZE Stack Size
286 _SC_THREAD_DESTRUCTOR_ PTHREAD_DESTRUCTOR_ Number attempts made
287 ITERATIONS ITERATIONS to destroy thread-
290 _SC_THREAD_KEYS_MAX PTHREAD_KEYS_MAX Max number of data
292 _SC_THREAD_PRIO_ _POSIX_THREAD_PRIO_ Supports Priority
293 INHERIT INHERIT Inheritance option
294 _SC_THREAD_PRIO_ _POSIX_THREAD_PRIO_ Supports Priority
295 PROTECT PROTECT Protection option
296 _SC_THREAD_PRIORITY_ _POSIX_THREAD_PRIORITY_ Supports Thread
297 SCHEDULING SCHEDULING Execution
299 _SC_THREAD_PROCESS_ _POSIX_THREAD_PROCESS_ Supports
300 SHARED SHARED Process-Shared
303 _SC_THREAD_SAFE_ _POSIX_THREAD_SAFE_ Supports Thread-Safe
304 FUNCTIONS FUNCTIONS Functions option
305 _SC_THREAD_STACK_MIN PTHREAD_STACK_MIN Min byte size of
307 _SC_THREAD_THREADS_MAX PTHREAD_THREADS_MAX Max number of
309 _SC_THREADS _POSIX_THREADS Supports Threads
311 _SC_TIMEOUTS _POSIX_TIMEOUTS Supports Timeouts
313 _SC_TIMER_MAX TIMER_MAX Max number of timer
316 _SC_TIMERS _POSIX_TIMERS Supports Timers
317 _SC_TTY_NAME_MAX TTYNAME_MAX Max length of tty
319 _SC_TZNAME_MAX TZNAME_MAX Max number of bytes
322 _SC_V6_ILP32_OFF32 _POSIX_V6_ILP32_OFF32 Supports X/Open
326 _SC_V6_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG Supports X/Open
330 _SC_V6_LP64_OFF64 _POSIX_V6_LP64_OFF64 Supports X/Open
334 _SC_V6_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG Same as
336 _SC_VERSION _POSIX_VERSION POSIX.1 version
338 _SC_XBS5_ILP32_OFF32 _XBS_ILP32_OFF32 Indicates support
342 _SC_XBS5_ILP32_OFFBIG _XBS5_ILP32_OFFBIG Indicates support
346 _SC_XBS5_LP64_OFF64 _XBS5_LP64_OFF64 Indicates support of
350 _SC_XBS5_LPBIG_OFFBIG _XBS5_LP64_OFF64 Same as
352 _SC_XOPEN_CRYPT _XOPEN_CRYPT Supports X/Open
355 _SC_XOPEN_ENH_I18N _XOPEN_ENH_I18N Supports X/Open
359 _SC_XOPEN_LEGACY _XOPEN_LEGACY Supports X/Open
361 _SC_XOPEN_REALTIME _XOPEN_REALTIME Supports X/Open
364 _SC_XOPEN_REALTIME_ _XOPEN_REALTIME_THREADS Supports X/Open
365 THREADS POSIX Reatime
368 _SC_XOPEN_SHM _XOPEN_SHM Supports X/Open
371 _SC_XOPEN_STREAMS _POSIX_XOPEN_STREAMS Supports XSI Streams
373 _SC_XOPEN_UNIX _XOPEN_UNIX Supports X/Open CAE
379 _SC_XOPEN_VERSION _XOPEN_VERSION Integer value
385 _SC_XOPEN_XCU_VERSION _XOPEN_XCU_VERSION Integer value
396 The following options are not supported and return \(mi1:
403 \fB_SC_2_PBS\fR \fB_POSIX2_PBS\fR
404 \fB_SC_2_PBS_ACCOUNTING\fR \fB_POSIX2_PBS_ACCOUNTING\fR
405 \fB_SC_2_PBS_CHECKPOINT\fR \fB_POSIX2_PBS_CHECKPOINT\fR
406 \fB_SC_2_PBS_LOCATE\fR \fB_POSIX2_PBS_LOCATE\fR
407 \fB_SC_2_PBS_MESSAGE\fR \fB_POSIX2_PBS_MESSAGE\fR
408 \fB_SC_2_PBS_TRACK\fR \fB_POSIX2_PBS_TRACK\fR
409 \fB_SC_ADVISORY_INFO\fR \fB_POSIX_ADVISORY_INFO\fR
410 \fB_SC_CPUTIME\fR \fB_POSIX_CPUTIME\fR
411 \fB_SC_SPORADIC_SERVER\fR \fB_POSIX_SPORADIC_SERVER\fR
412 \fB_SC_SS_REPL_MAX\fR \fB_POSIX_SS_REPL_MAX\fR
413 \fB_SC_THREAD_CPUTIME\fR \fB_POSIX_THREAD_CPUTIME\fR
414 \fB_SC_THREAD_SPORADIC_SERVER\fR \fB_POSIX_THREAD_SPORADIC_SERVER\fR
415 \fB_SC_TRACE\fR \fB_POSIX_TRACE\fR
416 \fB_SC_TRACE_EVENT_FILTER\fR \fB_POSIX_TRACE_EVENT_FILTER\fR
417 \fB_SC_TRACE_EVENT_NAME_MAX\fR \fB_POSIX_TRACE_EVENT_NAME_MAX\fR
418 \fB_SC_TRACE_INHERIT\fR \fB_POSIX_TRACE_INHERIT\fR
419 \fB_SC_TRACE_LOG\fR \fB_POSIX_TRACE_LOG\fR
420 \fB_SC_TRACE_NAME_MAX\fR \fB_POSIX_TRACE_NAME_MAX\fR
421 \fB_SC_TRACE_SYS_MAX\fR \fB_POSIX_TRACE_SYS_MAX\fR
422 \fB_SC_TRACE_USER_EVENT_MAX\fR \fB_POSIX_TRACE_USER_EVENT_MAX\fR
423 \fB_SC_TYPED_MEMORY_OBJECTS\fR \fB_POSIX_TYPED_MEMORY_OBJECTS\fR
429 Upon successful completion, \fBsysconf()\fR returns the current variable value
430 on the system. The value returned will not be more restrictive than the
431 corresponding value described to the application when it was compiled with the
432 implementation's <\fBlimits.h\fR>, <\fBunistd.h\fR> or <\fBtime.h\fR>. With
433 only a few obvious exceptions such as \fB_SC_AVPHYS_PAGES\fR and
434 \fB_SC_NPROCESSORS_ONLN\fR, the value will not change during the lifetime of
438 If \fIname\fR is an invalid value, \fBsysconf()\fR returns \fB\(mi1\fR and sets
439 \fBerrno\fR to indicate the error. If the variable corresponding to \fIname\fR
440 is associated with functionality that is not supported by the system,
441 \fBsysconf()\fR returns \fB\(mi1\fR without changing the value of \fIerrno\fR.
444 Calling \fBsysconf()\fR with the following returns \fB\(mi1\fR without setting
445 \fBerrno\fR, because no maximum limit can be determined. The system supports at
446 least the minimum values and can support higher values depending upon system
451 Variable Minimum supported value
452 _SC_AIO_MAX _POSIX_AIO_MAX
455 _SC_THREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
456 _SC_THREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
457 _SC_THREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
463 The following SPARC and x86 platform variables return \fBEINVAL\fR:
467 _SC_COHER_BLKSZ _SC_DCACHE_ASSOC
468 _SC_DCACHE_BLKSZ _SC_DCACHE_LINESZ
469 _SC_DCACHE_SZ _SC_DCACHE_TBLKSZ
470 _SC_ICACHE_ASSOC _SC_ICACHE_BLKSZ
471 _SC_ICACHE_LINESZ _SC_ICACHE_SZ
479 The \fBsysconf()\fR function will fail if:
486 The value of the \fIname\fR argument is invalid.
492 See \fBattributes\fR(5) for descriptions of the following attributes:
500 ATTRIBUTE TYPE ATTRIBUTE VALUE
502 Architecture SPARC and x86
504 Interface Stability Committed
506 MT-Level MT-Safe, Async-Signal-Safe
508 Standard See \fBstandards\fR(5).
514 \fBpooladm\fR(1M), \fBzoneadm\fR(1M), \fBfpathconf\fR(2), \fBseteuid\fR(2),
515 \fBsetrlimit\fR(2), \fBconfstr\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)
519 A call to \fBsetrlimit()\fR can cause the value of \fBOPEN_MAX\fR to change.
522 Multiplying \fBsysconf\fR(\fB_SC_PHYS_PAGES\fR) or
523 \fBsysconf\fR(\fB_SC_AVPHYS_PAGES\fR) by \fBsysconf\fR(\fB_SC_PAGESIZE\fR) to
524 determine memory amount in bytes can exceed the maximum values representable in
525 a 32-bit signed or unsigned integer.
528 The value of \fBCLK_TCK\fR can be variable and it should not be assumed that
529 \fBCLK_TCK\fR is a compile-time constant.
532 If the caller is in a non-global zone and the pools facility is active,
533 \fBsysconf\fR(\fB_SC_NPROCESSORS_CONF\fR) and
534 \fBsysconf\fR(\fB_SC_NPROCESSORS_ONLN\fR) return the number of processors in
535 the processor set of the pool to which the zone is bound.