[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

sysconf Subroutine

Purpose

Determines the current value of a specified system limit or option.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>


long int sysconf ( Name)
int Name;

Description

The sysconf subroutine determines the current value of certain system parameters, the configurable system limits, or whether optional features are supported. The Name parameter represents the system variable to be queried.

Parameters

Name   Specifies which system variable setting should be returned. The valid values for the Name parameter are defined in the limits.h, time.h, and unistd.h files and are described below:

_SC_AIO_LISTIO_MAX Maximum number of Input and Output operations that can be specified in a list Input and Output call.
_SC_AIO_MAX Maximum number of outstanding asynchronous Input and Output operations.
_SC_ASYNCHRONOUS_IO Implementation supports the Asynchronous Input and Output option.
_SC_ARG_MAX Specifies the maximum byte length of the arguments for one of the exec functions, including environment data.
_SC_BC_BASE_MAX Specifies the maximum number ibase and obase variables allowed by the bc command.
_SC_BC_DIM_MAX Specifies the maximum number of elements permitted in an array by the bc command.
_SC_BC_SCALE_MAX Specifies the maximum scale variable allowed by the bc command.
_SC_BC_STRING_MAX Specifies the maximum length of a string constant allowed by the bc command.
_SC_CHILD_MAX Specifies the number of simultaneous processes per real user ID.
_SC_CLK_TCK Indicates the clock-tick increment as defined by the CLK_TCK in the time.h file.
_SC_COLL_WEIGHTS_MAX Specifies the maximum number of weights that can be assigned to an entry of the LC_COLLATE keyword in the locale definition file.
_SC_DELAYTIMER_MAX Maximum number of Timer expiration overruns.
_SC_EXPR_NEST_MAX Specifies the maximum number of expressions that can be nested within parentheses by the expr command.
_SC_JOB_CONTROL If this symbol is defined, job control is supported.
_SC_IOV_MAX Specifies the maximum number of iovec structures one process has available for use with the readv and writev subroutines.
_SC_LARGE_PAGESIZE Size (in bytes) of a large-page.
_SC_LINE_MAX Specifies the maximum byte length of a command's input line (either standard input or another file) when a command is described as processing text files. The length includes room for the trailing new-line character.
_SC_LOGIN_NAME_MAX Maximum length of a login name.
_SC_MQ_OPEN_MAX Maximum number of open message queue descriptors.
_SC_MQ_PRIO_MAX Maximum number of message priorities.
_SC_MEMLOCK Implementation supports the Process Memory Locking option.
_SC_MEMLOCK_RANGE Implementation supports the Range Memory Locking option.
_SC_MEMORY_PROTECTION Implementation supports the Memory Protection option.
_SC_MESSAGE_PASSING Implementation supports the Message Passing option.
_SC_NGROUPS_MAX Specifies the maximum number of simultaneous supplementary group IDs per process.
_SC_OPEN_MAX Specifies the maximum number of files that one process can have open at any one time.
_SC_PASS_MAX Specifies the maximum number of significant characters in a password (not including the terminating null character).
_SC_PASS_MAX Maximum number of significant bytes in a password.
_SC_PAGESIZE Equivalent to _SC_PAGE_SIZE.
_SC_PAGE_SIZE Size in bytes of a page.
_SC_PRIORITIZED_IO Implementation supports the Prioritized Input and Output option.
_SC_PRIORITY_SCHEDULING Implementation supports the Process Scheduling option.
_SC_RE_DUP_MAX Specifies the maximum number of repeated occurrences of a regular expression permitted when using the \{ m\} interval notation.
_SC_RTSIG_MAX Maximum number of Realtime Signals reserved for applications use.
_SC_REALTIME_SIGNALS Implementation supports the Realtime Signals Extension option.
_SC_SAVED_IDS If this symbol is defined, each process has a saved set-user ID and set-group ID.
_SC_SEM_NSEMS_MAX Maximum number of Semaphores per process.
_SC_SEM_VALUE_MAX Maximum value a Semaphore may have.
_SC_SEMAPHORES Implementation supports the Semaphores option.
_SC_SHARED_MEMORY_OBJECTS Implementation supports the Shared Memory Objects option.
_SC_SIGQUEUE_MAX Maximum number of signals a process may send and have pending at any time.
_SC_STREAM_MAX Specifies the maximum number of streams that one process can have open simultaneously.
_SC_SYNCHRONIZED_IO Implementation supports the Synchronised Input and Output option.
_SC_TIMER_MAX Maximum number of per-process Timers.
_SC_TIMERS Implementation supports the Timers option.
_SC_TZNAME_MAX Specifies the maximum number of bytes supported for the name of a time zone (not of the TZ value).
_SC_VERSION Indicates that the version or revision number of the POSIX standard is implemented to indicate the 4-digit year and 2-digit month that the standard was approved by the IEEE Standards Board. This value is currently the long integer 198808.
_SC_XBS5_ILP32_OFF32 Implementation provides a C-language compilation environment with 32-bit int, long, pointer and off_t types.
_SC_XBS5_ILP32_OFFBIG Implementation provides a C-language compilation environment with 32-bit int, long and pointer types and an off_t type using at least 64 bits.
_SC_XBS5_LP64_OFF64 Implementation provides a C-language compilation environment with 32-bit int and 64-bit long, pointer and off_t types.
_SC_XBS5_LPBIG_OFFBIG Implementation provides a C-language compilation environment with an int type using at least 32 bits and long, pointer and off_t types using at least 64 bits.
_SC_XOPEN_CRYPT Indicates that the system supports the X/Open Encryption Feature Group.
_SC_XOPEN_LEGACY The implementation supports the Legacy Feature Group.
_SC_XOPEN_REALTIME The implementation supports the X/Open Realtime Feature Group.
_SC_XOPEN_REALTIME_THREADS The implementation supports the X/Open Realtime Threads Feature Group.
_SC_XOPEN_ENH_I18N Indicates that the system supports the X/Open Enhanced Internationalization Feature Group.
_SC_XOPEN_SHM Indicates that the system supports the X/Open Shared Memory Feature Group.
_SC_XOPEN_VERSION Indicates that the version or revision number of the X/Open standard is implemented.
_SC_XOPEN_XCU_VERSION Specifies the value describing the current version of the XCU specification.
_SC_ATEXIT_MAX Specifies the maximum number of register functions for the atexit subroutine.
_SC_PAGE_SIZE Specifies page-size granularity of memory.
_SC_AES_OS_VERSION Indicates OSF AES version.
_SC_2_VERSION Specifies the value describing the current version of POSIX.2.
_SC_2_C_BIND Indicates that the system supports the C Language binding option.
_SC_2_C_CHAR_TERM Indicates that the system supports at least one terminal type.
_SC_2_C_DEV Indicates that the system supports the C Language Development Utilities Option.
_SC_2_C_VERSION Specifies the value describing the current version of POSIX.2 with the C Language binding.
_SC_2_FORT_DEV Indicates that the system supports the FORTRAN Development Utilities Option.
_SC_2_FORT_RUN Indicates that the system supports the FORTRAN Development Utilities Option.
_SC_2_LOCALEDEF Indicates that the system supports the creation of locales.
_SC_2_SW_DEV Indicates that the system supports the Software Development Utilities Option.
_SC_2_UPE Indicates that the system supports the User Portability Utilities Option.
_SC_NPROCESSORS_CONF Number of processors configured.
_SC_NPROCESSORS_ONLN Number of processors online.
_SC_THREAD_DATAKEYS_MAX Maximum number of data keys that can be defined in a process.

_SC_THREAD_DESTRUCTOR_ITERATIONS Maximum number attempts made to destroy a thread's thread-specific data.
_SC_THREAD_KEYS_MAX Maximum number of data keys per process.
_SC_THREAD_STACK_MIN Minimum value for the threads stack size.
_SC_THREAD_THREADS_MAX Maximum number of threads within a process.
_SC_REENTRANT_FUNCTIONS System supports reentrant functions (reentrant functions must be used in multi-threaded applications).
_SC_THREADS System supports POSIX threads.
_SC_THREAD_ATTR_STACKADDR System supports the stack address option for POSIX threads (stackaddr attribute of threads).
_SC_THREAD_ATTR_STACKSIZE System supports the stack size option for POSIX threads (stacksize attribute of threads).
_SC_THREAD_PRIORITY_SCHEDULING System supports the priority scheduling for POSIX threads.
_SC_THREAD_PRIO_INHERIT System supports the priority inheritance protocol for POSIX threads (priority inversion protocol for mutexes).
_SC_THREAD_PRIO_PROTECT System supports the priority ceiling protocol for POSIX threads (priority inversion protocol for mutexes).
_SC_THREAD_PROCESS_SHARED System supports the process sharing option for POSIX threads (pshared attribute of mutexes and conditions).
_SC_TTY_NAME_MAX Maximum length of a terminal device name.
Note
The _SYNCHRONIZED_IO, _SC_FSYNC, and SC_MAPPED_FILES commands apply to operating system version 4.3 and later releases.
_SC_SYNCHRONIZED_IO Implementation supports the Synchronized Input and Output option.
_SC_FSYNC Implementation supports the File Synchronization option.
_SC_MAPPED_FILES Implementation supports the Memory Mapped Files option.
_SC_LPAR_ENABLED Indicates whether LPARs are enabled or not.
_SC_AIX_KERNEL_BITMODE Determines if the kernel is 32-bit or 64-bit.
_SC_AIX_REALMEM Determines the amount of real memory in kilobytes.
_SC_AIX_HARDWARE_BITMODE Determines whether the machine is 32-bit or 64-bit.
_SC_AIX_MP_CAPABLE Determines if the hardware is MP-capable or not.
Note
The _SC_AIX_MP_CAPABLE variable is available only to the root user.

The values returned for the variables supported by the system do not change during the lifetime of the process making the call.

Return Values

If the sysconf subroutine is successful, the current value of the system variable is returned. The returned value cannot be more restrictive than the corresponding value described to the application by the limits.h, time.h, or unistd.h file at compile time. The returned value does not change during the lifetime of the calling process. If the sysconf subroutine is unsuccessful, a value of -1 is returned.

Error Codes

If the Name parameter is invalid, a value of -1 is returned and the errno global variable is set to indicate the error. If the Name parameter is valid but is a variable not supported by the system, a value of -1 is returned, and the errno global variable is set to a value of EINVAL. If the system variable _SC_AIX_MP_CAPABLE is accessed by a non-root user, a value of -1 is returned and the errno global variable indicates the error

File

/usr/include/limits.h Contains system-defined limits.

Related Information

The confstr subroutine, pathconf subroutine.

The bc command, expr command.

Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]