Your Browser is not longer supported
Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...
{{viewport.spaceProperty.prod}}
sysconf - get numeric value of configurable system variable
&pagelevel(4)&pagelevel
Syntax | #include <unistd.h> long int sysconf(int name); |
Description | sysconf() can be used to determine the current value of a configurable system variable
specified by name. These values represent the configurable limits of the operating system. The table below lists the system variables from the headers limits.h , unistd.h or time.h for which values can be queried using sysconf() . The symbolic constants containing the corresponding values used for name are defined in unistd.h : System variable | Value of name (constant) | ARG_MAX
| _SC_ARG_MAX
| AIO_LISTIO_MAX
| _SC_AIO_LISTIO_MAX
| AIO_MAX
| _SC_AIO_MAX
| AIO_PRIO_DELTA_MAX
| _SC_AIO_PRIO_DELTA_MAX
| BC_BASE_MAX
| _SC_BC_BASE_MAX
| BC_DIM_MAX
| _SC_BC_DIM_MAX
| BC_SCALE_MAX
| _SC_BC_SCALE_MAX
| BC_STRING_MAX
| _SC_BC_STRING_MAX
| CHILD_MAX
| _SC_CHILD_MAX
| CLK_TCK
| _SC_CLK_TCK
| COLL_WEIGHTS_MAX
| _SC_COLL_WEIGHTS_MAX
| DELAYTIMER_MAX
| _SC_DELAYTIMER_MAX
| EXPR_NEST_MAX
| _SC_EXPR_NEST_MAX
| LINE_MAX
| _SC_LINE_MAX
| LOGIN_NAME_MAX
| _SC_LOGIN_NAME_MAX
| NGROUPS_MAX
| _SC_NGROUPS_MAX
| MQ_OPEN_MAX
| _SC_MQ_OPEN_MAX
| MQ_PRIO_MAX
| _SC_MQ_PRIO_MAX
| OPEN_MAX
| _SC_OPEN_MAX
| POSIX_ASYNCHRONOUS_IO
| _SC_ASYNCHRONOUS_IO
| _POSIX_FSYNC
| _SC_FSYNC
| _POSIX_MAPPED_FILES
| _SC_MAPPED_FILES
| _POSIX_MEMLOCK
| _SC_MEMLOCK
| _POSIX_MEMLOCK_RANGE
| _SC_MEMLOCK_RANGE
| _POSIX_MEMORY_PROTECTION
| _SC_MEMORY_PROTECTION
| _POSIX_MESSAGE_PASSING
| _SC_MESSAGE_PASSING
| _POSIX_PRIORITIZED_IO
| _SC_PRIORITIZED_IO
| _POSIX_PRIORITY_SCHEDULING
| _SC_PRIORITY_SCHEDULING
| _POSIX_REALTIME_SIGNALS
| _SC_REALTIME_SIGNALS
| _POSIX_SEMAPHORES
| _SC_SEMAPHORES
| _POSIX_SHARED_MEMORY_OBJECTS
| _SC_SHARED_MEMORY_OBJECTS
| _POSIX_SYNCHRONIZED_IO
| _SC_SYNCHRONIZED_IO
| _POSIX_THREADS
| _SC_THREADS
| _POSIX_THREAD_ATTR_STACKADDR
| _SC_THREAD_ATTR_STACKADDR
| _POSIX_THREAD_ATTR_STACKSIZE
| _SC_THREAD_ATTR_STACKSIZE
| _POSIX_THREAD_PRIORITY_SCHEDULING
| _SC_THREAD_PRIORITY_SCHEDULING
| _POSIX_THREAD_PRIO_INHERIT
| _SC_THREAD_PRIO_INHERIT
| _POSIX_THREAD_PRIO_PROTECT
| _SC_THREAD_PRIO_PROTECT
| _POSIX_THREAD_PROCESS_SHARED
| _SC_THREAD_PROCESS_SHARED
| _POSIX_THREAD_SAFE_FUNCTIONS
| _SC_THREAD_SAFE_FUNCTIONS
| _POSIX_TIMERS
| _SC_TIMERS
| _POSIX2_C_BIND
| _SC_2_C_BIND
| _POSIX2_C_DEV
| _SC_2_C_DEV
| _POSIX2_C_VERSION
| _SC_2_C_VERSION
| _POSIX2_CHAR_TERM
| _SC_2_CHAR_TERM
| _POSIX2_FORT_DEV
| _SC_2_FORT_DEV
| _POSIX2_FORT_RUN
| _SC_2_FORT_RUN
| _POSIX2_LOCALEDEF
| _SC_2_LOCALEDEF
| _POSIX2_SW_DEV
| _SC_2_SW_DEV
| _POSIX2_UPE
| _SC_2_UPE
| _POSIX2_VERSION
| _SC_2_VERSION
| _POSIX_JOB_CONTROL
| _SC_JOB_CONTROL
| _POSIX_SAVED_IDS
| _SC_SAVED_IDS
| _POSIX_VERSION
| _SC_VERSION
| PTHREAD_DESTRUCTOR_ITERATIONS
| _SC_THREAD_DESTRUCTOR_ITERATIONS
| PTHREAD_KEYS_MAX
| _SC_THREAD_KEYS_MAX
| PTHREAD_STACK_MIN
| _SC_THREAD_STACK_MIN
| PTHREAD_THREADS_MAX
| _SC_THREAD_THREADS_MAX
| PTHREAD_DESTRUCTOR_ITERATIONS
| _SC_THREAD_DESTRUCTOR_ITERATIONS
| PTHREAD_KEYS_MAX
| _SC_THREAD_KEYS_MAX
| PTHREAD_STACK_MIN
| _SC_THREAD_STACK_MIN
| PTHREAD_THREADS_MAX
| _SC_THREAD_THREADS_MAX
| RE_DUP_MAX
| _SC_RE_DUP_MAX
| RTSIG_MAX
| _SC_RTSIG_MAX
| SEM_NSEMS_MAX
| _SC_SEM_NSEMS_MAX
| SEM_VALUE_MAX
| _SC_SEM_VALUE_MAX
| STREAM_MAX
| _SC_STREAM_MAX
| SIGQUEUE_MAX
| _SC_SIGQUEUE_MAX
| TIMER_MAX
| _SC_TIMER_MAX
| TTY_NAME_MAX
| _SC_TTY_NAME_MAX
| TZNAME_MAX
| _SC_TZNAME_MAX
| Maximal size of the data buffer of the functions getgrgid_r() and getgrnam_r() | _SC_GETGR_R_SIZE_MAX
| Maximal size of the data buffer of the functions getpwnam_r() and getpwuid_r() | _SC_GETPW_R_SIZE_MAX
|
|
Return val. | Current numeric value of name |
|
| if successful. The returned value will not be lower than the corresponding value in the application if it were compiled with the implementation ́s limits.h or unistd.h . The value will not change during the lifetime of the calling process. |
| -1 | if name is an invalid value. errno is set to indicate the error. if name does not have a defined value. In this case, the value of errno is not changed. |
Errors | sysconf() will fail if:
|
| EINVAL
| The value of the name argument is invalid. |
Notes | Since all return values are permitted in a successful situation, applications wishing to check for error situations should set errno to 0, then call sysconf() , and if it returns -1, check to see if errno is non-zero. If the value of sysconf(_SC_2_VERSION) is not equal to the value of the symbolic constant _POSIX2_VERSION , the commands available via system() or popen() might not behave in conformance with XPG4. The interfaces described in this manual will, however, continue to operate in conformance with XPG4 even if sysconf(_SC_2_VERSION) reports that the commands no longer perform as defined in the standard. |
See also | pathconf() , limits.h , time.h , unistd.h .
|