limits.h - implementation-defined constants
#include <limits.h>
Some of the functionality described on this reference page extends the ISO C standard. Applications shall define the appropriate feature test macro (see the System Interfaces volume of IEEE Std 1003.1-2001, Section 2.2, The Compilation Environment) to enable the visibility of these symbols in this header.
Many of the symbols listed here are not defined by the ISO/IEC 9899:1999 standard. Such symbols are not shown as CX shaded.
The <limits.h> header shall define various symbolic names. Different categories of names are described below.
The names represent various limits on resources that the implementation imposes on applications.
Implementations may choose any appropriate value for each limit, provided it is not more restrictive than the Minimum Acceptable Values listed below. Symbolic constant names beginning with _POSIX may be found in <unistd.h> .
Applications should not assume any particular value for a limit. To achieve maximum portability, an application should not require more resource than the Minimum Acceptable Value quantity. However, an application wishing to avail itself of the full amount of a resource available on an implementation may make use of the value given in <limits.h> on that particular implementation, by using the symbolic names listed below. It should be noted, however, that many of the listed limits are not invariant, and at runtime, the value of the limit may differ from those given in this header, for the following reasons:
The limit is pathname-dependent.
The limit differs between the compile and runtime machines.
For these reasons, an application may use the fpathconf(), pathconf(), and sysconf() functions to determine the actual value of a limit at runtime.
The items in the list ending in _MIN give the most negative values that the mathematical types are guaranteed to be capable of representing. Numbers of a more negative value may be supported on some implementations, as indicated by the <limits.h> header on the implementation, but applications requiring such numbers are not guaranteed to be portable to all implementations. For positive constants ending in _MIN, this indicates the minimum acceptable value.
A definition of one of the symbolic names in the following list shall be omitted from <limits.h> on specific implementations where the corresponding value is equal to or greater than the stated minimum, but is unspecified.
This indetermination might depend on the amount of available memory space on a specific instance of a specific implementation. The actual value supported by a specific instance shall be provided by the sysconf() function.
Maximum number of I/O operations in a single list I/O call supported
by the implementation.
Minimum Acceptable Value: {_POSIX_AIO_LISTIO_MAX}
Maximum number of outstanding asynchronous I/O operations supported
by the implementation.
Minimum Acceptable Value: {_POSIX_AIO_MAX}
The maximum amount by which a process can decrease its asynchronous
I/O priority level from its own scheduling priority.
Minimum Acceptable Value: 0
Maximum number of functions that may be registered with atexit().
Minimum Acceptable Value: 32
Maximum number of timer expiration overruns.
Minimum Acceptable Value: {_POSIX_DELAYTIMER_MAX}
Maximum number of iovec structures that one process has available
for use with readv() or writev().
Minimum Acceptable Value: {_XOPEN_IOV_MAX}
The maximum number of open message queue descriptors a process may
hold.
Minimum Acceptable Value: {_POSIX_MQ_OPEN_MAX}
The maximum number of message priorities supported by the implementation.
Minimum Acceptable Value: {_POSIX_MQ_PRIO_MAX}
Equivalent to {PAGESIZE}. If either {PAGESIZE} or {PAGE_SIZE} is defined, the other is defined with the same value.
Maximum number of attempts made to destroy a thread's thread-specific
data values on thread exit.
Minimum Acceptable Value: {_POSIX_THREAD_DESTRUCTOR_ITERATIONS}
Maximum number of data keys that can be created by a process.
Minimum Acceptable Value: {_POSIX_THREAD_KEYS_MAX}
Minimum size in bytes of thread stack storage.
Minimum Acceptable Value: 0
Maximum number of threads that can be created per process.
Minimum Acceptable Value: {_POSIX_THREAD_THREADS_MAX}
Maximum number of realtime signals reserved for application use in
this implementation.
Minimum Acceptable Value: {_POSIX_RTSIG_MAX}
Maximum number of semaphores that a process may have.
Minimum Acceptable Value: {_POSIX_SEM_NSEMS_MAX}
The maximum value a semaphore may have.
Minimum Acceptable Value: {_POSIX_SEM_VALUE_MAX}
Maximum number of queued signals that a process may send and have
pending at the receiver(s) at any time.
Minimum Acceptable Value: {_POSIX_SIGQUEUE_MAX}
The maximum number of replenishment operations that may be simultaneously
pending for a particular sporadic server scheduler.
Minimum Acceptable Value: {_POSIX_SS_REPL_MAX}
Maximum number of timers per process supported by the implementation.
Minimum Acceptable Value: {_POSIX_TIMER_MAX}
Maximum length of the trace event name.
Minimum Acceptable Value: {_POSIX_TRACE_EVENT_NAME_MAX}
Maximum length of the trace generation version string or of the trace
stream name.
Minimum Acceptable Value: {_POSIX_TRACE_NAME_MAX}
Maximum number of trace streams that may simultaneously exist in the
system.
Minimum Acceptable Value: {_POSIX_TRACE_SYS_MAX}
Maximum number of user trace event type identifiers that may simultaneously
exist in a traced process, including the predefined
user trace event POSIX_TRACE_UNNAMED_USER_EVENT.
Minimum Acceptable Value: {_POSIX_TRACE_USER_EVENT_MAX}
The values in the following list may be constants within an implementation or may vary from one pathname to another. For example, file systems or directories may have different characteristics.
A definition of one of the values shall be omitted from the <limits.h> header on specific implementations where the corresponding value is equal to or greater than the stated minimum, but where the value can vary depending on the file to which it is applied. The actual value supported for a specific pathname shall be provided by the pathconf() function.
Minimum number of bytes of storage actually allocated for any portion
of a file.
Minimum Acceptable Value: Not specified.
Recommended increment for file transfer sizes between the {POSIX_REC_MIN_XFER_SIZE}
and {POSIX_REC_MAX_XFER_SIZE} values.
Minimum Acceptable Value: Not specified.
Maximum recommended file transfer size.
Minimum Acceptable Value: Not specified.
Minimum recommended file transfer size.
Minimum Acceptable Value: Not specified.
Recommended file transfer buffer alignment.
Minimum Acceptable Value: Not specified.
The magnitude limitations in the following list shall be fixed by specific implementations. An application should assume that the value supplied by <limits.h> in a specific implementation is the minimum that pertains whenever the application is run under that implementation. A specific instance of a specific implementation may increase the value relative to that supplied by <limits.h> for that implementation. The actual value supported by a specific instance shall be provided by the sysconf() function.
The symbolic constants in the following list shall be defined in <limits.h> with the values shown. These are symbolic names for the most restrictive value for certain features on an implementation supporting the Timers option. A conforming implementation shall provide values no larger than these values. A conforming application must not require a smaller value for correct operation.
The resolution of the CLOCK_REALTIME clock, in nanoseconds.
Value: 20 000 000
If the Monotonic Clock option is supported, the resolution of the CLOCK_MONOTONIC clock, in nanoseconds, is represented by {_POSIX_CLOCKRES_MIN}.
The symbolic constants in the following list shall be defined in <limits.h> with the values shown. These are symbolic names for the most restrictive value for certain features on an implementation conforming to this volume of IEEE Std 1003.1-2001. Related symbolic constants are defined elsewhere in this volume of IEEE Std 1003.1-2001 which reflect the actual implementation and which need not be as restrictive. A conforming implementation shall provide values at least this large. A strictly conforming application must not require a larger value for correct operation.
The number of I/O operations that can be specified in a list I/O call.
Value: 2
The number of outstanding asynchronous I/O operations.
Value: 1
The number of timer expiration overruns.
Value: 32
The number of message queues that can be open for a single process.
Value: 8
The maximum number of message priorities supported by the implementation.
Value: 32
The number of realtime signal numbers reserved for application use.
Value: 8
The number of semaphores that a process may have.
Value: 256
The maximum value a semaphore may have.
Value: 32 767
The number of queued signals that a process may send and have pending
at the receiver(s) at any time.
Value: 32
The number of replenishment operations that may be simultaneously
pending for a particular sporadic server scheduler.
Value: 4
The number of attempts made to destroy a thread's thread-specific
data values on thread exit.
Value: 4
The number of data keys per process.
Value: 128
The number of threads per process.
Value: 64
The per-process number of timers.
Value: 32
The length in bytes of a trace event name.
Value: 30
The length in bytes of a trace generation version string or a trace
stream name.
Value: 8
The number of trace streams that may simultaneously exist in the system.
Value: 8
The number of user trace event type identifiers that may simultaneously
exist in a traced process, including the predefined user
trace event POSIX_TRACE_UNNAMED_USER_EVENT.
Value: 32
Maximum number of iovec structures that one process has available
for use with readv() or writev().
Value: 16
Maximum number of bytes in a filename (not including the terminating
null).
Value: 255
Maximum number of bytes in a pathname.
Value: 1024
The values in the following lists shall be defined in <limits.h> and are constant expressions suitable for use in #if preprocessing directives. Moreover, except for {CHAR_BIT}, {DBL_DIG}, {DBL_MAX}, {FLT_DIG}, {FLT_MAX}, {LONG_BIT}, {WORD_BIT}, and {MB_LEN_MAX}, the symbolic names are defined as expressions of the correct type.
If the value of an object of type char is treated as a signed integer when used in an expression, the value of {CHAR_MIN} is the same as that of {SCHAR_MIN} and the value of {CHAR_MAX} is the same as that of {SCHAR_MAX}. Otherwise, the value of {CHAR_MIN} is 0 and the value of {CHAR_MAX} is the same as that of {UCHAR_MAX}.
Number of bits in a long.
Minimum Acceptable Value: 32
Number of bits in a word or type int.
Minimum Acceptable Value: 16
The following constants shall be defined on all implementations in <limits.h>:
Maximum number of bytes in a character class name.
Minimum Acceptable Value: 14
Maximum value of digit in calls to the printf() and scanf()
functions.
Minimum Acceptable Value: 9
Maximum number of bytes in a LANG name.
Minimum Acceptable Value: 14
Maximum message number.
Minimum Acceptable Value: 32 767
Maximum number of bytes in an N-to-1 collation mapping.
Minimum Acceptable Value: No guaranteed value across all conforming
implementations.
Maximum set number.
Minimum Acceptable Value: 255
Maximum number of bytes in a message string.
Minimum Acceptable Value: {_POSIX2_LINE_MAX}
Default process priority.
Minimum Acceptable Value: 20
The following sections are informative.
A request was made to reduce the value of {_POSIX_LINK_MAX} from the value of 8 specified for it in the POSIX.1-1990 standard to 2. The standard developers decided to deny this request for several reasons:
They wanted to avoid making any changes to the standard that could break conforming applications, and the requested change could have that effect.
The use of multiple hard links to a file cannot always be replaced with use of symbolic links. Symbolic links are semantically different from hard links in that they associate a pathname with another pathname rather than a pathname with a file. This has implications for access control, file permanence, and transparency.
The original standard developers had considered the issue of allowing for implementations that did not in general support hard links, and decided that this would reduce consensus on the standard.
Systems that support historical versions of the development option of the ISO POSIX-2 standard retain the name {_POSIX2_RE_DUP_MAX} as an alias for {_POSIX_RE_DUP_MAX}.
The System Interfaces volume of IEEE Std 1003.1-2001, fpathconf(), pathconf(), sysconf()
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |