📄 limits.h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title><limits.h></title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_347"> </a>NAME</h4><blockquote>limits.h - implementation-dependent constants</blockquote><h4><a name = "tag_000_007_348"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <limits.h></code></pre></blockquote><h4><a name = "tag_000_007_349"> </a>DESCRIPTION</h4><blockquote>The<i><limits.h></i>header defines various symbolic names.Different categories of names are described below.<p>The names represent various limits on resources that thesystem imposes on applications.<p>Implementations may choose any appropriate value for each limit, provided itis not more restrictive than the Minimum Acceptable Values listed below.Symbolic constant names beginning with _POSIX may be found in<i><a href="unistd.h.html"><unistd.h></a></i>.<p>Applications should not assume any particular value for a limit.To achieve maximum portability, an application should not requiremore resource than the Minimum Acceptable Value quantity.However, an application wishing to avail itself of the full amount ofa resource available on an implementation may make use of the value given in<i><limits.h></i>on that particular system, by using the symbolic names listed below.It should be noted, however, that many of the listedlimits are not invariant, and at run time, the value of the limit may differfrom those given in this header, for the following reasons:<ul><p><li>The limit is pathname-dependent.<p><li>The limit differs between the compile and run-time machines.<p></ul><p>For these reasons, an application may use the<i><a href="fpathconf.html">fpathconf()</a></i>,<i><a href="pathconf.html">pathconf()</a></i>and<i><a href="sysconf.html">sysconf()</a></i>functions to determine the actual value of a limit at run time.<p>The items in the list ending in _MIN give the most negative values that themathematical types are guaranteed to be capable of representing.Numbers of a more negative value may be supported on some systems,as indicated by the<i><limits.h></i>header on the system, but applications requiring such numbers are notguaranteed to be portable to all systems.<p>The Minimum Acceptable Value symbol * indicates that there is noguaranteed value across all XSI-conformant systems.<h5><a name = "tag_000_007_349_001"> </a>Run-time Invariant Values (Possibly Indeterminate)</h5>A definition of one of the symbolic names in the following list will beomitted from<i><limits.h></i>on specific implementations where the corresponding value is equal to orgreater than the stated minimum, but is indeterminate.<p>This might depend on the amount of available memory space on a specificinstance of a specific implementation. The actual value supported by aspecific instance will be provided by the<i><a href="sysconf.html">sysconf()</a></i>function.<dl compact><dt>AIO_LISTIO_MAX<dd>Maximum number of I/O operations in a single list I/O callsupported by the implementation.Minimum Acceptable Value: _POSIX_AIO_LISTIO_MAX<dt>AIO_MAX<dd>Maximum number of outstanding asynchronous I/O operationssupported by the implementation.Minimum Acceptable Value: _POSIX_AIO_MAX<dt>AIO_PRIO_DELTA_MAX<dd>The maximum amount by which a process can decrease itsasynchronous I/O priority level from its own scheduling priority.Minimum Acceptable Value: 0<dt>ARG_MAX<dd>Maximum length of argument to the <i>exec</i> functionsincluding environment data.Minimum Acceptable Value: _POSIX_ARG_MAX<dt>ATEXIT_MAX<dd>Maximum number of functions that may be registered with<i><a href="atexit.html">atexit()</a></i>.Minimum Acceptable Value: 32<dt>CHILD_MAX<dd>Maximum number of simultaneous processes per real user ID.Minimum Acceptable Value:25<dt>DELAYTIMER_MAX<dd>Maximum number of timer expiration overruns.Minimum Acceptable Value: _POSIX_DELAYTIMER_MAX<dt>IOV_MAX<dd>Maximum number of <b>iovec</b> structures that oneprocess has available for use with<i><a href="readv.html">readv()</a></i>or<i><a href="writev.html">writev()</a></i>.Minimum Acceptable Value: _XOPEN_IOV_MAX<dt>LOGIN_NAME_MAX<dd>Maximum length of a login name.Minimum Acceptable Value: _POSIX_LOGIN_NAME_MAX<dt>MQ_OPEN_MAX<dd>The maximum number of open message queue descriptors a process may hold.Minimum Acceptable Value: _POSIX_MQ_OPEN_MAX<dt>MQ_PRIO_MAX<dd>The maximum number of message priorities supported by the implementation.Minimum Acceptable Value: _POSIX_MQ_PRIO_MAX<dt>OPEN_MAX<dd>Maximum number of files that one process can have open at any one time.Minimum Acceptable Value:20<dt>PAGESIZE<dd>Size in bytes of a page.Minimum Acceptable Value: 1<dt>PAGE_SIZE<dd>Same as PAGESIZE.If either PAGESIZE or PAGE_SIZE is defined, the other will bedefined with the same value.<dt>PASS_MAX<dd>Maximum number of significant bytes in a password (notincluding terminating null). (<b>LEGACY</b>)Minimum Acceptable Value: 8<dt>PTHREAD_DESTRUCTOR_ITERATIONS<dd>Maximum number of attempts made to destroy a thread'sthread-specific data values on thread exit.Minimum Acceptable Value: _POSIX_THREAD_DESTRUCTOR_ITERATIONS<dt>PTHREAD_KEYS_MAX<dd>Maximum number of data keys that can be created by a process.Minimum Acceptable Value: _POSIX_THREAD_KEYS_MAX<dt>PTHREAD_STACK_MIN<dd>Minimum size in bytes of thread stack storage.Minimum Acceptable Value: 0<dt>PTHREAD_THREADS_MAX<dd>Maximum number of threads that that can be created per process.Minimum Acceptable Value: _POSIX_THREAD_THREADS_MAX<dt>RTSIG_MAX<dd>Maximum number of realtime signals reserved for application use in thisimplementation.Minimum Acceptable Value: _POSIX_RTSIG_MAX<dt>SEM_NSEMS_MAX<dd>Maximum number of semaphores that a process may have.Minimum Acceptable Value: _POSIX_SEM_NSEMS_MAX<dt>SEM_VALUE_MAX<dd>The maximum value a semaphore may have.Minimum Acceptable Value: _POSIX_SEM_VALUE_MAX<dt>SIGQUEUE_MAX<dd>Maximum number of queued signals that a processmay send and have pending at the receiver(s) at any time.Minimum Acceptable Value: _POSIX_SIGQUEUE_MAX<dt>STREAM_MAX<dd>The number of streams that one process can have open atone time. If defined, it has the same value as {FOPEN_MAX} (see<i><a href="stdio.h.html"><stdio.h></a></i>).Minimum Acceptable Value: _POSIX_STREAM_MAX<dt>TIMER_MAX<dd>Maximum number of timers per-process supported by the implementation.Minimum Acceptable Value: _POSIX_TIMER_MAX<dt>TTY_NAME_MAX<dd>Maximum length of terminal device name.Minimum Acceptable Value: _POSIX_TTY_NAME_MAX<dt>TZNAME_MAX<dd>Maximum number of bytes supported for the name of a time zone (not ofthe TZ variable).Minimum Acceptable Value: _POSIX_TZNAME_MAX</dl><h5><a name = "tag_000_007_349_002"> </a>Pathname Variable Values</h5><p>The values in the following list may be constants within animplementation or may vary from one pathname to another. For example,file systems or directories may have different characteristics.<p>A definition of one of the values will be omitted from the<i><limits.h></i>header on specific implementations where the corresponding value isequal to or greater than the stated minimum, but where the value can varydepending on the file to which it is applied. The actual valuesupported for a specific pathname will be provided by the<i><a href="pathconf.html">pathconf()</a></i>function.<dl compact><dt>FILESIZEBITS<dd>Minimum number of bits needed to represent, as a signed integervalue, the maximum size of a regular file allowed in the specified directory.Minimum Acceptable Value: 32<dt>LINK_MAX<dd>Maximum number of links to a single file.Minimum Acceptable Value: _POSIX_LINK_MAX<dt>MAX_CANON<dd>Maximum number of bytes in a terminal canonical input line.Minimum Acceptable Value: _POSIX_MAX_CANON<dt>MAX_INPUT<dd>Minimum number of bytes for which space will be available in aterminal input queue; therefore, the maximum number of bytes aportable application may require to be typed as input before reading them.Minimum Acceptable Value: _POSIX_MAX_INPUT<dt>NAME_MAX<dd>Maximum number of bytes in a filename (not including terminating null).Minimum Acceptable Value: _POSIX_NAME_MAX<dt>PATH_MAX<dd>Maximum number of bytes in a pathname, including the terminatingnull character.Minimum Acceptable Value: _POSIX_PATH_MAX<dt>PIPE_BUF<dd>Maximum number of bytes that is guaranteed to be atomic whenwriting to a pipe.Minimum Acceptable Value: _POSIX_PIPE_BUF</dl><h5><a name = "tag_000_007_349_003"> </a>Run-time Increasable Values</h5><p>The magnitude limitations in the following list will be fixed byspecific implementations.An application should assume that the value supplied by<i><limits.h></i>in a specific implementation is the minimum that pertains whenever theapplication is run under that implementation.A specific instance of a specific implementation may increase thevalue relative to that supplied by<i><limits.h></i>for that implementation.The actual value supported by a specific instance will be provided by the<i><a href="sysconf.html">sysconf()</a></i>function.<dl compact><dt>BC_BASE_MAX<dd>Maximum<i>obase</i>values allowed by the<i><a href="../xcu/bc.html">bc</a></i>utility.Minimum Acceptable Value: _POSIX2_BC_BASE_MAX<dt>BC_DIM_MAX<dd>Maximum number of elements permitted in an array by the<i><a href="../xcu/bc.html">bc</a></i>utility.Minimum Acceptable Value: _POSIX2_BC_DIM_MAX<dt>BC_SCALE_MAX<dd>Maximum<i>scale</i>value allowed by the<i><a href="../xcu/bc.html">bc</a></i>utility.Minimum Acceptable Value: _POSIX2_BC_SCALE_MAX<dt>BC_STRING_MAX<dd>Maximum length of a string constant accepted by the<i><a href="../xcu/bc.html">bc</a></i>utility.Minimum Acceptable Value: _POSIX2_BC_STRING_MAX<dt>COLL_WEIGHTS_MAX<dd>Maximum number of weights that can be assigned to an entry of theLC_COLLATE <b>order</b> keyword in the locale definition file;see the <b>XBD</b> specification, <a href="../xbd/locale.html"><b>Locale</b> </a>.Minimum Acceptable Value: _POSIX2_COLL_WEIGHTS_MAX<dt>EXPR_NEST_MAX<dd>Maximum number of expressions that can be nested within parentheses by the<i><a href="../xcu/expr.html">expr</a></i>utility.Minimum Acceptable Value: _POSIX2_EXPR_NEST_MAX<dt>LINE_MAX<dd>Unless otherwise noted, the maximum length, in bytes, of a utility's inputline (either standard input or another file), when the utility is describedas processing text files. The length includes room for the trailing newline.Minimum Acceptable Value: _POSIX2_LINE_MAX<dt>NGROUPS_MAX<dd>Maximum number of simultaneous supplementary group IDs per process.Minimum Acceptable Value: 8<dt>RE_DUP_MAX<dd>Maximum number of repeated occurrences of a regular expressionpermitted when using the interval notation \{<i>m</i>,<i>n</i>\};see the <b>XBD</b> specification, <a href="../xbd/re.html"><b>Regular Expressions</b> </a>.Minimum Acceptable Value: _POSIX2_RE_DUP_MAX</dl><h5><a name = "tag_000_007_349_004"> </a>Maximum Values</h5><p>The symbolic constants in the following list are defined in<i><limits.h></i>with the values shown. These are symbolic names for the mostrestrictive value for certain features on a system supporting theRealtime Feature Group. A conforming implementation will providevalues no larger than these values. A portable application will notrequire a smaller value for correct operation.<dl compact><dt>_POSIX_CLOCKRES_MIN<dd>The CLOCK_REALTIME clock resolution, in nanosecondsValue: 20 000 000</dl><h5><a name = "tag_000_007_349_005"> </a>Minimum Values</h5><p>The symbolic constants in the following list are defined in<i><limits.h></i>with the values shown. These are symbolic names for the most restrictive valuefor certain features on a system conforming to this specification. Relatedsymbolic constants are defined elsewhere in this specification whichreflect the actual implementation and which need not be as restrictive.A conforming implementation will provide values at least this large.A portable application must not require a larger value for correct operation.<dl compact><dt>_POSIX_AIO_LISTIO_MAX<dd>The number of I/O operations that can be specified in alist I/O call.Value: 2<dt>_POSIX_AIO_MAX<dd>The number of outstanding asynchronous I/O operations.Value: 1<dt>_POSIX_ARG_MAX<dd>Maximum length of argument to the <i>exec</i> functions includingenvironment data.Value: 4 096<dt>_POSIX_CHILD_MAX<dd>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -