2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94
29 .\" $FreeBSD: src/lib/libc/gen/sysconf.3,v 1.8.2.6 2001/12/14 18:33:51 ru Exp $
36 .Nd get configurable system variables
42 .Fn sysconf "int name"
44 This interface is defined by
46 A far more complete interface is available using
51 function provides a method for applications to determine the current
52 value of a configurable system limit or option variable.
55 argument specifies the system variable to be queried.
56 Symbolic constants for each name value are found in the include file
59 The available values are as follows:
61 .It Dv _SC_ADVISORY_INFO
66 option to which the system attempts to conform,
68 .It Dv _SC_AIO_LISTIO_MAX
69 Maximum number of I/O operations in a single list I/O call supported.
71 Maximum number of outstanding asynchronous I/O operations supported.
72 .It Dv _SC_AIO_PRIO_DELTA_MAX
73 The maximum amount by which a process can decrease its asynchronous I/O
74 priority level from its own scheduling priority.
75 .It Dv _SC_ASYNCHRONOUS_IO
79 Asynchronous Input and Output
80 option to which the system attempts to conform,
83 The maximum bytes of argument to
86 Maximum number of functions that may be registered with
93 option to which the system attempts to conform,
95 .It Dv _SC_BC_BASE_MAX
96 The maximum ibase/obase values in the
100 The maximum array size in the
103 .It Dv _SC_BC_SCALE_MAX
104 The maximum scale value in the
107 .It Dv _SC_BC_STRING_MAX
108 The maximum string length in the
112 The maximum number of simultaneous processes per user id.
114 The frequency of the statistics clock in ticks per second.
115 .It Dv _SC_CLOCK_SELECTION
116 Return the POSIX version the implementation of the Clock Selection Option
117 on this system conforms to, or \-1 if unavailable.
118 .It Dv _SC_COLL_WEIGHTS_MAX
119 The maximum number of weights that can be assigned to any entry of
120 the LC_COLLATE order keyword in the locale definition file.
123 .Dv CLOCK_PROCESS_CPUTIME_ID
124 clock ID is supported, otherwise \-1.
125 .It Dv _SC_DELAYTIMER_MAX
126 Maximum number of timer expiration overruns.
127 .It Dv _SC_EXPR_NEST_MAX
128 The maximum number of expressions that can be nested within
133 Return 1 if the File Synchronization Option is available on this system,
135 .It Dv _SC_GETGR_R_SIZE_MAX
136 Suggested initial value for the size of the group entry buffer.
137 .It Dv _SC_GETPW_R_SIZE_MAX
138 Suggested initial value for the size of the password entry buffer.
139 .It Dv _SC_HOST_NAME_MAX
140 Maximum length of a host name (not including the terminating null) as
145 The maximum number of elements in the I/O vector used by
156 option to which the system attempts to conform,
158 .It Dv _SC_JOB_CONTROL
159 Return 1 if job control is available on this system, otherwise \-1.
161 The maximum length in bytes of a text-processing utility's input
163 .It Dv _SC_LOGIN_NAME_MAX
164 Maximum length of a login name.
165 .It Dv _SC_MAPPED_FILES
166 Return 1 if the Memory Mapped Files Option is available on this system,
169 Return 1 if the Process Memory Locking Option is available on this system,
171 .It Dv _SC_MEMLOCK_RANGE
172 Return 1 if the Range Memory Locking Option is available on this system,
174 .It Dv _SC_MEMORY_PROTECTION
175 Return 1 if the Memory Protection Option is available on this system,
177 .It Dv _SC_MESSAGE_PASSING
178 Whether Message Passing option is supported.
179 .It Dv _SC_MONOTONIC_CLOCK
180 Return the POSIX version of the implementation of the Monotonic Clock
181 option that this system conforms to, or \-1 if unavailable.
182 .It Dv _SC_MQ_OPEN_MAX
183 The maximum number of open message queue descriptors per process.
184 .It Dv _SC_MQ_PRIO_MAX
185 The maximum number of message priorities supported by the implementation.
186 .It Dv _SC_NGROUPS_MAX
187 The maximum number of supplemental groups.
189 The maximum number of open files per user id.
191 The size of a system page in bytes.
195 .It Dv _SC_PRIORITIZED_IO
199 Prioritized Input and Output
200 option to which the system attempts to conform,
202 .It Dv _SC_PRIORITY_SCHEDULING
207 option to which the system attempts to conform,
209 .It Dv _SC_RAW_SOCKETS
214 option to which the system attempts to conform,
216 .It Dv _SC_READER_WRITER_LOCKS
221 option to which the system attempts to conform,
223 .It Dv _SC_REALTIME_SIGNALS
227 Realtime Signals Extension
228 option to which the system attempts to conform,
230 .It Dv _SC_RE_DUP_MAX
231 The maximum number of repeated occurrences of a regular expression
232 permitted when using interval notation.
234 Return 1 if the system supports regular expression handling.
236 Maximum number of realtime signals reserved for application use.
238 Return 1 if saved set-group and saved set-user ID is available,
240 .It Dv _SC_SEMAPHORES
245 option to which the system attempts to conform,
247 .It Dv _SC_SEM_NSEMS_MAX
248 Maximum number of semaphores that a process may have.
249 .It Dv _SC_SEM_VALUE_MAX
250 The maximum value a semaphore may have.
251 .It Dv _SC_SHARED_MEMORY_OBJECTS
255 Shared Memory Objects
256 option to which the system attempts to conform,
259 Return 1 if the system supports the
262 .It Dv _SC_SIGQUEUE_MAX
263 Maximum number of queued signals that a process may send and have pending at
264 the receiver(s) at any time.
270 option to which the system attempts to conform,
272 .It Dv _SC_SPIN_LOCKS
277 option to which the system attempts to conform,
279 .It Dv _SC_SPORADIC_SERVER
283 Process Sporadic Server
284 option to which the system attempts to conform,
286 .It Dv _SC_STREAM_MAX
287 The maximum number of streams that a process may have open at any one time.
288 .It Dv _SC_SYMLOOP_MAX
289 Maximum number of symbolic links that can be reliably traversed in the
290 resolution of a pathname in the absence of a loop.
291 .It Dv _SC_SYNCHRONIZED_IO
292 Return 1 if the Synchronized I/O Option is available on this system,
294 .It Dv _SC_THREAD_ATTR_STACKADDR
298 Thread Stack Address Attribute
299 option to which the system attempts to conform,
301 .It Dv _SC_THREAD_ATTR_STACKSIZE
305 Thread Stack Size Attribute
306 option to which the system attempts to conform,
308 .It Dv _SC_THREAD_CPUTIME
310 .Dv CLOCK_THREAD_CPUTIME_ID
311 clock ID is supported, otherwise \-1.
312 .It Dv _SC_THREAD_PRIO_INHERIT
316 Thread Priority Inheritance
317 option to which the system attempts to conform,
319 .It Dv _SC_THREAD_PRIO_PROTECT
320 Whether the system supports the priority ceiling protocol for POSIX threads.
321 .It Dv _SC_THREAD_PRIORITY_SCHEDULING
325 Thread Execution Scheduling
326 option to which the system attempts to conform,
328 .It Dv _SC_THREAD_PROCESS_SHARED
332 Thread Process-Shared Synchronization
333 option to which the system attempts to conform,
335 .It Dv _SC_THREAD_ROBUST_PRIO_INHERIT
339 Robust Mutex Priority Inheritance
340 option to which the system attempts to conform,
342 .It Dv _SC_THREAD_ROBUST_PRIO_PROTECT
346 Robust Mutex Priority Protection
347 option to which the system attempts to conform,
354 option to which the system attempts to conform,
356 .It Dv _SC_THREAD_SAFE_FUNCTIONS
357 The level of support for thread-safe (re-entrant) functions.
358 .It Dv _SC_THREAD_SPORADIC_SERVER
362 Thread Sporadic Server
363 option to which the system attempts to conform,
365 .It Dv _SC_THREAD_STACK_MIN
366 Minimum size in bytes of thread stack storage.
367 .It Dv _SC_THREAD_THREADS_MAX
368 Maximum number of threads that can be created per process.
374 option to which the system attempts to conform,
377 Maximum number of timers per process supported.
383 option to which the system attempts to conform,
385 .It Dv _SC_TTY_NAME_MAX
386 Maximum length of terminal device name.
387 .It Dv _SC_TYPED_MEMORY_OBJECTS
392 option to which the system attempts to conform,
394 .It Dv _SC_TZNAME_MAX
395 The maximum number of bytes supported for the name of a timezone.
399 with which the system
402 Return 1 if the system supports the
404 Shared Memory Feature
405 for both compilation and execution, or 0 if only compilation support is
407 .It Dv _SC_XOPEN_VERSION
408 An integer value greater than or equal to 4,
409 indicating the version of the X/Open Portability Guide to which this
412 Return 1 if the system's C-language development facilities support the
413 C-Language Bindings Option, otherwise \-1.
415 Return 1 if the system supports the C-Language Development Utilities Option,
417 .It Dv _SC_2_CHAR_TERM
418 Return 1 if the system supports at least one terminal type capable of
419 all operations described in
422 .It Dv _SC_2_FORT_DEV
423 Return 1 if the system supports the FORTRAN Development Utilities Option,
425 .It Dv _SC_2_FORT_RUN
426 Return 1 if the system supports the FORTRAN Runtime Utilities Option,
428 .It Dv _SC_2_LOCALEDEF
429 Return 1 if the system supports the creation of locales, otherwise \-1.
431 Return 1 if the system supports the Software Development Utilities Option,
434 Return 1 if the system supports the User Portability Utilities Option,
439 with which the system attempts to comply.
442 These values also exist, but may not be standard:
444 .It Dv _SC_LEVEL1_DCACHE_LINESIZE
445 Returns the L1 cache line size.
446 .It Dv _SC_NPROCESSORS_CONF
447 The number of processors configured.
448 .It Dv _SC_NPROCESSORS_ONLN
449 The number of processors online.
450 .It Dv _SC_PHYS_PAGES
451 The number of pages of physical memory.
456 is not successful, \-1 is returned and
458 is set appropriately.
459 Otherwise, if the variable is associated with functionality that is not
460 supported, \-1 is returned and
463 Otherwise, the current variable value is returned.
465 Because \-1 is a valid return value upon success, applications wishing
466 to check for real error conditions should set
476 function may fail and set
478 for any of the errors specified for the library function
480 In addition, the following error may be reported:
493 Except for the fact that values returned by
495 may change over the lifetime of the calling process,
496 this function conforms to
499 .Dv _SC_NPROCESSORS_CONF
501 .Dv _SC_NPROCESSORS_ONLN
502 are nonstandard, but implemented in many systems.
506 function first appeared in