sysconf()

get value of configurable system limit or option 

Function


SYNOPSIS

#include <unistd.h>

long sysconf(int name);


DESCRIPTION

The sysconf() function provides a method for the application to determine the current value of a configurable system limit or option.

The NuTCRACKER Platform supports the values listed below for name. These variables correspond to a compile-time constant listed in <limits.h>, <unistd.h> or <time.h>. For each of these, the compile-time constant is listed after the sysconf() parameter name.

_SC_2_C_BIND [_POSIX2_C_BIND]  

A value other than -1 if the C Language Binding option is supported.

_SC_2_C_DEV [_POSIX2_C_DEV]  

A value other than -1 if the C Language Development Utilities option is supported.

_SC_2_C_VERSION [_POSIX2_C_VERSION]  

An integer value indicating the version of the ISO POSIX-2 standard C Language Binding implemented. It changes with each new version of the standard.

_SC_2_CHAR_TERM [_POSIX2_CHAR_TERM]  

A value other than -1 is returned if at least one terminal type is supported.

_SC_2_FORT_DEV [_POSIX2_FORT_DEV]  

A value other than -1 if the Fortran Development Utilities option is supported.

_SC_2_FORT_RUN [_POSIX2_FORT_RUN]  

A value other than -1 if the Fortran Run-time Utilities option is supported.

_SC_2_LOCALEDEF [_POSIX2_LOCALEDEF]  

A value other than -1 if the creation of locales by the localedef utility is supported.

_SC_2_SW_DEV [_POSIX2_SW_DEV]  

A value other than -1 if the Software Development Utilities option is supported.

_SC_2_UPE [_POSIX2_UPE]  

A value other than -1 if the User Portability Utilities option is supported.

_SC_2_VERSION [_POSIX2_VERSION]  

An integer value indicating the version of the ISO POSIX-2 standard implemented. It changes with each new version of the standard.

_SC_AIO_LISTIO_MAX [AIO_LISTIO_MAX]  

The maximum number of I/O operations supported in a single list I/O call.

_SC_AIO_MAX [AIO_MAX]  

The maximum number of outstanding asynchronous I/O operations.

_SC_AIO_PRIO_DELTA_MAX [AIO_PRIO_DELTA_MAX]  

The maximum amount by which a process can decrease its asynchronous I/O priority level from its own scheduling priority.

_SC_ARG_MAX [ARG_MAX]  

The maximum length of the argument list to the exec() family of functions, including environment data.

_SC_ASYNCHRONOUS_IO [_POSIX_ASYNCHRONOUS_IO]  

A value other than -1 indicates that the Asynchronous Input/Output option is supported.

_SC_ATEXIT_MAX [ATEXIT_MAX]  

The maximum number of functions that may be registered with atexit().

_SC_BC_BASE_MAX [BC_BASE_MAX]  

The maximum obase values accepted by the bc utility.

_SC_BC_DIM_MAX [BC_DIM_MAX]  

The maximum number of elements permitted in an array by the bc utility.

_SC_BC_SCALE_MAX [BC_SCALE_MAX]  

The maximum scale value accepted by the bc utility.

_SC_BC_STRING_MAX [BC_STRING_MAX]  

The maximum length of a string constant accepted by the bc utility.

_SC_CHILD_MAX [CHILD_MAX]  

The maximum number of simultaneous processes per real user ID.

_SC_CLK_TCK [CLK_TCK]  

The number of clock-ticks per second returned by times().

_SC_COLL_WEIGHTS_MAX [COLL_WEIGHTS_MAX]  

The maximum number of weights that can be assigned to an entry of the LC_COLLATE order keyword in a locale definition file.

_SC_DELAYTIMER_MAX [DELAYTIMER_MAX]  

The maximum number of timer expiration overruns.

_SC_EXPR_NEST_MAX [EXPR_NEST_MAX]  

The maximum number of expressions that can be nested within parentheses by the expr utility.

_SC_FSYNC [_POSIX_FSYNC]  

A value other than -1 indicates that the File Synchronization option is supported.

_SC_GETGR_R_SIZE_MAX [GETGR_R_SIZE_MAX]  

The maximum size needed for the group information buffer to be filled in by getgrgid_r() or getgrnam_r().

_SC_GETPW_R_SIZE_MAX [GETPW_R_SIZE_MAX]  

The maximum size needed for the user information buffer to be filled in by getpwnam_r() or getpwuid_r().

_SC_IOV_MAX [IOV_MAX]  

The maximum number of iovec structures that one process has available for use with readv() or writev().

_SC_JOB_CONTROL [_POSIX_JOB_CONTROL]  

A value other than -1 indicates that the Job Control option is supported.

_SC_LINE_MAX [LINE_MAX]  

The maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing newline character. The documentation for a utility may indicate that a different line length is supported.

_SC_LOGIN_NAME_MAX [LOGIN_NAME_MAX]  

The maximum length of a user's login name.

_SC_MAPPED_FILES [_POSIX_MAPPED_FILES]  

A value other than -1 indicates that the Memory Mapped Files option is supported.

_SC_MEMLOCK [_POSIX_MEMLOCK]  

A value other than -1 indicates that the Process Memory Locking option is supported.

_SC_MEMLOCK_RANGE [_POSIX_MEMLOCK_RANGE]  

A value other than -1 indicates that the Range Memory Locking option is supported.

_SC_MEMORY_PROTECTION [_POSIX_MEMORY_PROTECTION]  

A value other than -1 indicates that the Memory Protection option is supported.

_SC_MESSAGE_PASSING [_POSIX_MESSAGE_PASSING]  

A value other than -1 indicates that the Message Passing option is supported.

_SC_MQ_OPEN_MAX [MQ_OPEN_MAX]  

The maximum number of open message queue descriptors a process may hold.

_SC_MQ_PRIO_MAX [MQ_PRIO_MAX]  

The maximum number of message priorities supported.

_SC_NGROUPS_MAX [NGROUPS_MAX]  

The maximum number of simultaneous supplementary group IDs per process.

_SC_NPROCESSORS_CONF [NPROCESSORS_CONF]  

The number of processors configured in the system.

_SC_NPROCESSORS_ONLN [NPROCESSORS_ONLN]  

The number of processors currently running in the system.

_SC_NUTC_OS_ALLOCGRANULARITY  

The granularity with which virtual memory is allocated by the system. This may not be the same as the physical page size.

_SC_NUTC_OS_PAGESIZE  

The size of a page of physical memory, in bytes.

_SC_NUTC_OS_PLATFORM  

A constant indicating the Windows systems that the NuTCRACKER Platform is currently running on. One of the following values: NUTC_PLAT_UNKNOWN, NUTC_PLAT_WIN2003, NUTC_PLAT_LONGHORN, NUTC_PLAT_WINDOWS7, NUTC_PLAT_WINDOWS8 or NUTC_PLAT_WINDOWS10.

_SC_OPEN_MAX [OPEN_MAX]  

The maximum number of files that one process can have open at any one time.

_SC_PAGESIZE [PAGESIZE]  

The size of a page of physical memory, in bytes.

_SC_PAGE_SIZE [PAGE_SIZE]  

Same as _SC_PAGESIZE.

_SC_PRIORITIZED_IO [_POSIX_PRIORITIZED_IO]  

A value other than -1 indicates that the Prioritized Input and Output option is supported.

_SC_PRIORITY_SCHEDULING [_POSIX_PRIORITY_SCHEDULING]  

A value other than -1 indicates that the Process Scheduling option is supported.

_SC_REGEXP [_POSIX_REGEXP]  

A value other than -1 indicates that the Regular Expression Handling option is supported.

_SC_RE_DUP_MAX [RE_DUP_MAX]  

The maximum number of repeated occurrences of a regular expression permitted when using the interval notation \{m,n\}.

_SC_RTSIG_MAX [RTSIG_MAX]  

The maximum number of realtime signals reserved for application use.

_SC_SAVED_IDS [_POSIX_SAVED_IDS]  

A value other than -1 indicates that each process has a saved set-user-ID and a saved set-group-ID.

_SC_SEMAPHORES [_POSIX_SEMAPHORES]  

A value other than -1 indicates that the Semaphores option is supported.

_SC_SEM_NSEMS_MAX [SEM_NSEMS_MAX]  

The maximum number of semaphores that a process may have.

_SC_SEM_VALUE_MAX [SEM_VALUE_MAX]  

The maximum value a semaphore may have.

_SC_SHARED_MEMORY_OBJECTS [_POSIX_SHARED_MEMORY_OBJECTS]  

A value other than -1 indicates that the Shared Memory Objects option is supported.

_SC_SHELL [_POSIX_SHELL

A value other -1 indicates that the POSIX shell is supported.

_SC_SIGQUEUE_MAX [SIGQUEUE_MAX]  

The maximum number of queued signals that a process may send and have pending at the receiver(s) at any time.

_SC_STREAM_MAX [STREAM_MAX]  

The number of streams that one process can have open at one time.

_SC_SYMLOOP_MAX [SYMLOOP_MAX]  

Maximum number of symbolic links that can be reliably traversed in the resolution of a path name in the absence of a loop.

_SC_SYNCHRONIZED_IO [_POSIX_SYNCHRONIZED_IO]  

A value other than -1 indicates that the Synchronized Input and Output option is supported.

_SC_THREAD_ATTR_STACKADDR [_POSIX_THREAD_ATTR_STACKADDR]  

A value other than -1 indicates that the thread stack address attribute option is supported.

_SC_THREAD_ATTR_STACKSIZE [_POSIX_THREAD_ATTR_STACKSIZE]  

A value other than -1 indicates that the thread stack size attribute option is supported.

_SC_THREAD_DESTRUCTOR_ITERATIONS [PTHREAD_DESTRUCTOR_ITERATIONS]  

The maximum number of attempts made to destroy a thread's thread-specific data values on thread exit.

_SC_THREAD_KEYS_MAX [PTHREAD_KEYS_MAX]  

The maximum number of thread-specific data keys that can be created by a process.

_SC_THREAD_PRIO_INHERIT [_POSIX_THREAD_PRIO_INHERIT]  

A value other than -1 indicates that the thread priority inheritance option is supported.

_SC_THREAD_PRIO_PROTECT [_POSIX_THREAD_PRIO_PROTECT]  

A value other than -1 indicates that the thread priority protection option is supported.

_SC_THREAD_PRIORITY_SCHEDULING [_POSIX_THREAD_PRIORITY_SCHEDULING]  

A value other than -1 indicates that the thread execution scheduling option is supported.

_SC_THREAD_PROCESS_SHARED [_POSIX_THREAD_PROCESS_SHARED]  

A value other than -1 indicates that the process-shared synchronization object option is supported.

_SC_THREAD_SAFE_FUNCTIONS [_POSIX_THREAD_SAFE_FUNCTIONS]  

A value other than -1 indicates that the thread-safe functions option is supported.

_SC_THREAD_STACK_MIN [PTHREAD_STACK_MIN]  

The minimum size in bytes of thread stack storage.

_SC_THREAD_THREADS_MAX [PTHREAD_THREADS_MAX]  

The maximum number of threads that can be created per process.

_SC_THREADS [_POSIX_THREADS]  

A value other than -1 indicates that the POSIX Thread option is supported.

_SC_TIMER_MAX [TIMER_MAX]  

The maximum number of timers supported in each process.

_SC_TIMERS [_POSIX_TIMERS]  

A value other than -1 indicates that the Timers option is supported.

_SC_TTY_NAME_MAX [TTY_NAME_MAX]  

The maximum length of a terminal device name.

_SC_TZNAME_MAX [TZNAME_MAX]  

The maximum number of bytes supported for the name of a time zone.

_SC_VERSION [_POSIX_VERSION]  

An integer value indicating the version of the ISO POSIX-1 standard (C Language Binding) implemented. It changes with each new version of the standard.

_SC_XBS5_ILP32_OFF32 [_XBS5_ILP32_OFF32]  

A value other than -1 indicates that a C-language compilation environment with 32-bit int, long, pointer, and off_t types is available.

_SC_XBS5_ILP32_OFFBIG [_XBS5_ILP32_OFFBIG]  

A value other than -1 indicates that a C-language compilation environment with 32-bit int, long, and pointer types and an off_t type supporting at least 64 bits, is available.

_SC_XBS5_LP64_OFF64 [_XBS5_LP64_OFF64]  

A value other than -1 indicates that a C-language compilation environment with 32-bit int and 64-bit long, pointer, and off_t types is available.

_SC_XBS5_LPBIG_OFFBIG [_XBS5_LPBIG_OFFBIG]  

A value other than -1 indicates that a C-language compilation environment with an int type of at least 32-bits and long, pointer, and off_t types of at least 64 bits is available.

_SC_XOPEN_CRYPT [_XOPEN_CRYPT]  

A value other than -1 indicates that the X/Open Encryption Feature Group is supported.

_SC_XOPEN_ENH_I18N [_XOPEN_ENH_I18N]  

A value other than -1 indicates that the Enhanced Internationalization Feature Group is supported.

_SC_XOPEN_LEGACY [_XOPEN_LEGACY]  

A value other than -1 indicates that the Legacy Feature Group is supported.

_SC_XOPEN_REALTIME [_XOPEN_REALTIME]  

A value other than -1 indicates that the X/Open Realtime Feature Group is supported.

_SC_XOPEN_REALTIME_THREADS [_XOPEN_REALTIME_THREADS]  

A value other than -1 indicates that the X/Open Realtime Threads Feature Group is supported.

_SC_XOPEN_SHM [_XOPEN_SHM]  

A value other than -1 indicates that the Shared Memory Feature Group is supported.

_SC_XOPEN_UNIX [_XOPEN_UNIX]  

A value other than -1 indicates that the X/Open CAE Specification, January 1997, System Interfaces and Header, Issue 5, is supported.

_SC_XOPEN_XCU_VERSION [_XOPEN_XCU_VERSION]  

A value other than -1 indicates the supported version of the X/Open Command and Utilities specification.

_SC_XOPEN_XPG2 [_XOPEN_XPG2]  

A value other than -1 indicates that the X/Open Portability Guide, Volume 2, January 1987, XVS System Calls and Libraries, is supported.

_SC_XOPEN_XPG3 [_XOPEN_XPG3]  

A value other than -1 indicates that the X/Open Specification, February 1992, System Interfaces and Headers, Issues 3, is supported.

_SC_XOPEN_XPG4 [_XOPEN_XPG4]  

A value other than -1 indicates that the X/Open CAE Specification, July, 1992, System Interfaces and Headers, Issue 4, is supported.


PARAMETERS

name 

Is the system variable to be queried, from the list given in the DESCRIPTION section.


RETURN VALUES

If name is an invalid value, sysconf() returns -1 and sets errno to indicate the error, as shown below. If the variable corresponding to name is associated with functionality that is not supported, sysconf() returns -1 without changing the value of errno. Otherwise, sysconf() returns the current variable value on the system, as described above. The value returned is not more restrictive than the corresponding compile-time value as found in <limits.h>, <unistd.h>, or <time.h>. The value does not change during the lifetime of the calling process.

Note:

The value returned for sysconf(_SC_OPEN_MAX) may change if a call to setrlimit() adjusts the RLIMIT_NOFILE soft limit.

EINVAL 

The value of name is invalid.


CONFORMANCE

UNIX 98, with exceptions.


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

Windows uses a virtual memory allocation granularity that does not necessarily match the system page size. This affects the size and alignment of memory allocated with shmget()/shmat() and mmap(). Because there may be a need for both parameters, the NuTCRACKER Platform provides the _SC_NUTC_OS_ALLOCGRANULARITY and _SC_NUTC_OS_PAGESIZE parameters for sysconf().

Refer to the Porting to Windows 9x section of the The Porting Process chapter of the PTC MKS Toolkit UNIX to Windows Porting Guide for more information on _SC_NUTC_OS_PLATFORM.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
_NutConfStr(), confstr(), fpathconf(), pathconf()


PTC MKS Toolkit 10.4 Documentation Build 39.