1limits.h(0P)               POSIX Programmer's Manual              limits.h(0P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       limits.h — implementation-defined constants
14

SYNOPSIS

16       #include <limits.h>
17

DESCRIPTION

19       Some of the functionality described on this reference page extends  the
20       ISO C  standard. Applications shall define the appropriate feature test
21       macro (see the System Interfaces volume of POSIX.1‐2008,  Section  2.2,
22       The  Compilation Environment) to enable the visibility of these symbols
23       in this header.
24
25       Many  of  the  symbols   listed   here   are   not   defined   by   the
26       ISO/IEC 9899:1999  standard.  Such  symbols are not shown as CX shaded,
27       except under the heading ``Numerical Limits''.
28
29       The <limits.h> header shall define macros and  symbolic  constants  for
30       various  limits.   Different  categories of limits are described below,
31       representing  various  limits  on  resources  that  the  implementation
32       imposes  on applications.  All macros and symbolic constants defined in
33       this header shall be suitable for use in #if preprocessing directives.
34
35       Implementations may choose any appropriate value for each  limit,  pro‐
36       vided  it  is  not  more restrictive than the Minimum Acceptable Values
37       listed below. Symbolic constant names  beginning  with  _POSIX  may  be
38       found in <unistd.h>.
39
40       Applications  should  not  assume  any particular value for a limit. To
41       achieve maximum portability, an application  should  not  require  more
42       resource than the Minimum Acceptable Value quantity. However, an appli‐
43       cation wishing to avail itself of the full amount of a resource  avail‐
44       able on an implementation may make use of the value given in <limits.h>
45       on that particular implementation, by using  the  macros  and  symbolic
46       constants  listed  below. It should be noted, however, that many of the
47       listed limits are not invariant, and at runtime, the value of the limit
48       may differ from those given in this header, for the following reasons:
49
50        *  The limit is pathname-dependent.
51
52        *  The limit differs between the compile and runtime machines.
53
54       For  these reasons, an application may use the fpathconf(), pathconf(),
55       and sysconf() functions to determine the actual value  of  a  limit  at
56       runtime.
57
58       The items in the list ending in _MIN give the most negative values that
59       the mathematical types are guaranteed to be  capable  of  representing.
60       Numbers  of  a more negative value may be supported on some implementa‐
61       tions, as indicated by the <limits.h> header on the implementation, but
62       applications  requiring  such numbers are not guaranteed to be portable
63       to all implementations. For positive constants  ending  in  _MIN,  this
64       indicates the minimum acceptable value.
65
66   Runtime Invariant Values (Possibly Indeterminate)
67       A  definition  of  one  of the symbolic constants in the following list
68       shall be omitted from <limits.h> on specific implementations where  the
69       corresponding value is equal to or greater than the stated minimum, but
70       is unspecified.
71
72       This indetermination might depend on the  amount  of  available  memory
73       space  on  a specific instance of a specific implementation. The actual
74       value supported by  a  specific  instance  shall  be  provided  by  the
75       sysconf() function.
76
77       {AIO_LISTIO_MAX}
78             Maximum  number  of I/O operations in a single list I/O call sup‐
79             ported by the implementation.
80             Minimum Acceptable Value: {_POSIX_AIO_LISTIO_MAX}
81
82       {AIO_MAX}
83             Maximum number of outstanding asynchronous  I/O  operations  sup‐
84             ported by the implementation.
85             Minimum Acceptable Value: {_POSIX_AIO_MAX}
86
87       {AIO_PRIO_DELTA_MAX}
88             The  maximum amount by which a process can decrease its asynchro‐
89             nous I/O priority level from its own scheduling priority.
90             Minimum Acceptable Value: 0
91
92       {ARG_MAX}
93             Maximum length of argument to the exec functions including  envi‐
94             ronment data.
95             Minimum Acceptable Value: {_POSIX_ARG_MAX}
96
97       {ATEXIT_MAX}
98             Maximum number of functions that may be registered with atexit().
99             Minimum Acceptable Value: 32
100
101       {CHILD_MAX}
102             Maximum number of simultaneous processes per real user ID.
103             Minimum Acceptable Value: {_POSIX_CHILD_MAX}
104
105       {DELAYTIMER_MAX}
106             Maximum number of timer expiration overruns.
107             Minimum Acceptable Value: {_POSIX_DELAYTIMER_MAX}
108
109       {HOST_NAME_MAX}
110             Maximum  length  of  a  host  name (not including the terminating
111             null) as returned from the gethostname() function.
112             Minimum Acceptable Value: {_POSIX_HOST_NAME_MAX}
113
114       {IOV_MAX}
115             Maximum number of iovec structures that one process has available
116             for use with readv() or writev().
117             Minimum Acceptable Value: {_XOPEN_IOV_MAX}
118
119       {LOGIN_NAME_MAX}
120             Maximum length of a login name.
121             Minimum Acceptable Value: {_POSIX_LOGIN_NAME_MAX}
122
123       {MQ_OPEN_MAX}
124             The  maximum  number  of open message queue descriptors a process
125             may hold.
126             Minimum Acceptable Value: {_POSIX_MQ_OPEN_MAX}
127
128       {MQ_PRIO_MAX}
129             The maximum number of message priorities supported by the  imple‐
130             mentation.
131             Minimum Acceptable Value: {_POSIX_MQ_PRIO_MAX}
132
133       {OPEN_MAX}
134             A  value  one  greater than the maximum value that the system may
135             assign to a newly-created file descriptor.
136             Minimum Acceptable Value: {_POSIX_OPEN_MAX}
137
138       {PAGESIZE}
139             Size in bytes of a page.
140             Minimum Acceptable Value: 1
141
142       {PAGE_SIZE}
143             Equivalent to {PAGESIZE}.  If either {PAGESIZE} or {PAGE_SIZE} is
144             defined, the other is defined with the same value.
145
146       {PTHREAD_DESTRUCTOR_ITERATIONS}
147             Maximum number of attempts made to destroy a thread's thread-spe‐
148             cific data values on thread exit.
149             Minimum Acceptable Value: {_POSIX_THREAD_DESTRUCTOR_ITERATIONS}
150
151       {PTHREAD_KEYS_MAX}
152             Maximum number of data keys that can be created by a process.
153             Minimum Acceptable Value: {_POSIX_THREAD_KEYS_MAX}
154
155       {PTHREAD_STACK_MIN}
156             Minimum size in bytes of thread stack storage.
157             Minimum Acceptable Value: 0
158
159       {PTHREAD_THREADS_MAX}
160             Maximum number of threads that can be created per process.
161             Minimum Acceptable Value: {_POSIX_THREAD_THREADS_MAX}
162
163       {RE_DUP_MAX}
164             Maximum number of repeated occurrences of a BRE or  ERE  interval
165             expression;  see Section 9.3.6, BREs Matching Multiple Characters
166             and Section 9.4.6, EREs Matching Multiple Characters.
167             Minimum Acceptable Value: {_POSIX2_RE_DUP_MAX}
168
169       {RTSIG_MAX}
170             Maximum number of realtime signals reserved for  application  use
171             in this implementation.
172             Minimum Acceptable Value: {_POSIX_RTSIG_MAX}
173
174       {SEM_NSEMS_MAX}
175             Maximum number of semaphores that a process may have.
176             Minimum Acceptable Value: {_POSIX_SEM_NSEMS_MAX}
177
178       {SEM_VALUE_MAX}
179             The maximum value a semaphore may have.
180             Minimum Acceptable Value: {_POSIX_SEM_VALUE_MAX}
181
182       {SIGQUEUE_MAX}
183             Maximum number of queued signals that a process may send and have
184             pending at the receiver(s) at any time.
185             Minimum Acceptable Value: {_POSIX_SIGQUEUE_MAX}
186
187       {SS_REPL_MAX}
188             The maximum number of replenishment operations that may be simul‐
189             taneously pending for a particular sporadic server scheduler.
190             Minimum Acceptable Value: {_POSIX_SS_REPL_MAX}
191
192       {STREAM_MAX}
193             Maximum  number  of streams that one process can have open at one
194             time.  If defined, it has the  same  value  as  {FOPEN_MAX}  (see
195             <stdio.h>).
196             Minimum Acceptable Value: {_POSIX_STREAM_MAX}
197
198       {SYMLOOP_MAX}
199             Maximum  number  of symbolic links that can be reliably traversed
200             in the resolution of a pathname in the absence of a loop.
201             Minimum Acceptable Value: {_POSIX_SYMLOOP_MAX}
202
203       {TIMER_MAX}
204             Maximum number of timers per process supported by the implementa‐
205             tion.
206             Minimum Acceptable Value: {_POSIX_TIMER_MAX}
207
208       {TRACE_EVENT_NAME_MAX}
209             Maximum  length of the trace event name (not including the termi‐
210             nating null).
211             Minimum Acceptable Value: {_POSIX_TRACE_EVENT_NAME_MAX}
212
213       {TRACE_NAME_MAX}
214             Maximum length of the trace generation version string or  of  the
215             trace stream name (not including the terminating null).
216             Minimum Acceptable Value: {_POSIX_TRACE_NAME_MAX}
217
218       {TRACE_SYS_MAX}
219             Maximum  number of trace streams that may simultaneously exist in
220             the system.
221             Minimum Acceptable Value: {_POSIX_TRACE_SYS_MAX}
222
223       {TRACE_USER_EVENT_MAX}
224             Maximum number of user trace  event  type  identifiers  that  may
225             simultaneously  exist  in  a traced process, including the prede‐
226             fined user trace event POSIX_TRACE_UNNAMED_USER_EVENT.
227             Minimum Acceptable Value: {_POSIX_TRACE_USER_EVENT_MAX}
228
229       {TTY_NAME_MAX}
230             Maximum length of terminal device name.
231             Minimum Acceptable Value: {_POSIX_TTY_NAME_MAX}
232
233       {TZNAME_MAX}
234             Maximum number of bytes supported for the name of a timezone (not
235             of the TZ variable).
236             Minimum Acceptable Value: {_POSIX_TZNAME_MAX}
237
238       Note:     The length given by {TZNAME_MAX} does not include the quoting
239                 characters mentioned in Section 8.3, Other Environment  Vari‐
240                 ables.
241
242   Pathname Variable Values
243       The values in the following list may be constants within an implementa‐
244       tion or may vary from one pathname to another. For example,  file  sys‐
245       tems or directories may have different characteristics.
246
247       A  definition  of  one  of the symbolic constants in the following list
248       shall be omitted from the <limits.h> header on specific implementations
249       where  the  corresponding  value is equal to or greater than the stated
250       minimum, but where the value can vary depending on the file to which it
251       is applied. The actual value supported for a specific pathname shall be
252       provided by the pathconf() function.
253
254       {FILESIZEBITS}
255             Minimum number of bits needed to represent, as a  signed  integer
256             value,  the  maximum size of a regular file allowed in the speci‐
257             fied directory.
258             Minimum Acceptable Value: 32
259
260       {LINK_MAX}
261             Maximum number of links to a single file.
262             Minimum Acceptable Value: {_POSIX_LINK_MAX}
263
264       {MAX_CANON}
265             Maximum number of bytes in a terminal canonical input line.
266             Minimum Acceptable Value: {_POSIX_MAX_CANON}
267
268       {MAX_INPUT}
269             Minimum number of bytes for which space is available in a  termi‐
270             nal  input  queue;  therefore, the maximum number of bytes a con‐
271             forming application may require to be typed as input before read‐
272             ing them.
273             Minimum Acceptable Value: {_POSIX_MAX_INPUT}
274
275       {NAME_MAX}
276             Maximum  number  of bytes in a filename (not including the termi‐
277             nating null of a filename string).
278             Minimum Acceptable Value: {_POSIX_NAME_MAX}
279             Minimum Acceptable Value: {_XOPEN_NAME_MAX}
280
281       {PATH_MAX}
282             Maximum number of bytes the implementation will store as a  path‐
283             name in a user-supplied buffer of unspecified size, including the
284             terminating null character.  Minimum  number  the  implementation
285             will accept as the maximum number of bytes in a pathname.
286             Minimum Acceptable Value: {_POSIX_PATH_MAX}
287             Minimum Acceptable Value: {_XOPEN_PATH_MAX}
288
289       {PIPE_BUF}
290             Maximum  number  of  bytes  that  is guaranteed to be atomic when
291             writing to a pipe.
292             Minimum Acceptable Value: {_POSIX_PIPE_BUF}
293
294       {POSIX_ALLOC_SIZE_MIN}
295             Minimum number of bytes of storage  actually  allocated  for  any
296             portion of a file.
297             Minimum Acceptable Value: Not specified.
298
299       {POSIX_REC_INCR_XFER_SIZE}
300             Recommended   increment  for  file  transfer  sizes  between  the
301             {POSIX_REC_MIN_XFER_SIZE} and {POSIX_REC_MAX_XFER_SIZE} values.
302             Minimum Acceptable Value: Not specified.
303
304       {POSIX_REC_MAX_XFER_SIZE}
305             Maximum recommended file transfer size.
306             Minimum Acceptable Value: Not specified.
307
308       {POSIX_REC_MIN_XFER_SIZE}
309             Minimum recommended file transfer size.
310             Minimum Acceptable Value: Not specified.
311
312       {POSIX_REC_XFER_ALIGN}
313             Recommended file transfer buffer alignment.
314             Minimum Acceptable Value: Not specified.
315
316       {SYMLINK_MAX}
317             Maximum number of bytes in a symbolic link.
318             Minimum Acceptable Value: {_POSIX_SYMLINK_MAX}
319
320   Runtime Increasable Values
321       The magnitude limitations in the following list shall be fixed by  spe‐
322       cific  implementations.  An application should assume that the value of
323       the symbolic constant defined by <limits.h> in a  specific  implementa‐
324       tion is the minimum that pertains whenever the application is run under
325       that implementation. A specific instance of a  specific  implementation
326       may increase the value relative to that supplied by <limits.h> for that
327       implementation. The actual value supported by a specific instance shall
328       be provided by the sysconf() function.
329
330       {BC_BASE_MAX}
331             Maximum obase values allowed by the bc utility.
332             Minimum Acceptable Value: {_POSIX2_BC_BASE_MAX}
333
334       {BC_DIM_MAX}
335             Maximum  number of elements permitted in an array by the bc util‐
336             ity.
337             Minimum Acceptable Value: {_POSIX2_BC_DIM_MAX}
338
339       {BC_SCALE_MAX}
340             Maximum scale value allowed by the bc utility.
341             Minimum Acceptable Value: {_POSIX2_BC_SCALE_MAX}
342
343       {BC_STRING_MAX}
344             Maximum length of a string constant accepted by the bc utility.
345             Minimum Acceptable Value: {_POSIX2_BC_STRING_MAX}
346
347       {CHARCLASS_NAME_MAX}
348             Maximum number of bytes in a character class name.
349             Minimum Acceptable Value: {_POSIX2_CHARCLASS_NAME_MAX}
350
351       {COLL_WEIGHTS_MAX}
352             Maximum number of weights that can be assigned to an entry of the
353             LC_COLLATE order keyword in the locale definition file; see Chap‐
354             ter 7, Locale.
355             Minimum Acceptable Value: {_POSIX2_COLL_WEIGHTS_MAX}
356
357       {EXPR_NEST_MAX}
358             Maximum number of expressions that can be nested within parenthe‐
359             ses by the expr utility.
360             Minimum Acceptable Value: {_POSIX2_EXPR_NEST_MAX}
361
362       {LINE_MAX}
363             Unless  otherwise noted, the maximum length, in bytes, of a util‐
364             ity's input line (either standard input or  another  file),  when
365             the  utility  is  described  as processing text files. The length
366             includes room for the trailing <newline>.
367             Minimum Acceptable Value: {_POSIX2_LINE_MAX}
368
369       {NGROUPS_MAX}
370             Maximum  number  of  simultaneous  supplementary  group  IDs  per
371             process.
372             Minimum Acceptable Value: {_POSIX_NGROUPS_MAX}
373
374       {RE_DUP_MAX}
375             Maximum  number  of  repeated occurrences of a regular expression
376             permitted when using the interval notation \{m,n\};  see  Chapter
377             9, Regular Expressions.
378             Minimum Acceptable Value: {_POSIX2_RE_DUP_MAX}
379
380   Maximum Values
381       The  <limits.h>  header  shall  define the following symbolic constants
382       with the values shown. These are the most restrictive values  for  cer‐
383       tain  features  on an implementation. A conforming implementation shall
384       provide values no larger than these values.  A  conforming  application
385       must not require a smaller value for correct operation.
386
387       {_POSIX_CLOCKRES_MIN}
388             The resolution of the CLOCK_REALTIME clock, in nanoseconds.
389             Value: 20 000 000
390
391             If the Monotonic Clock option is supported, the resolution of the
392             CLOCK_MONOTONIC  clock,  in  nanoseconds,   is   represented   by
393             {_POSIX_CLOCKRES_MIN}.
394
395   Minimum Values
396       The  <limits.h>  header  shall  define the following symbolic constants
397       with the values shown. These are the most restrictive values  for  cer‐
398       tain  features  on  an  implementation  conforming  to  this  volume of
399       POSIX.1‐2008. Related symbolic constants are defined elsewhere in  this
400       volume  of  POSIX.1‐2008  which  reflect  the actual implementation and
401       which need not be as restrictive. For each of these limits, a  conform‐
402       ing  implementation  shall provide a value at least this large or shall
403       have no limit. A strictly conforming application  must  not  require  a
404       larger value for correct operation.
405
406       {_POSIX_AIO_LISTIO_MAX}
407             The  number of I/O operations that can be specified in a list I/O
408             call.
409             Value: 2
410
411       {_POSIX_AIO_MAX}
412             The number of outstanding asynchronous I/O operations.
413             Value: 1
414
415       {_POSIX_ARG_MAX}
416             Maximum length of argument to the exec functions including  envi‐
417             ronment data.
418             Value: 4 096
419
420       {_POSIX_CHILD_MAX}
421             Maximum number of simultaneous processes per real user ID.
422             Value: 25
423
424       {_POSIX_DELAYTIMER_MAX}
425             The number of timer expiration overruns.
426             Value: 32
427
428       {_POSIX_HOST_NAME_MAX}
429             Maximum  length  of  a  host  name (not including the terminating
430             null) as returned from the gethostname() function.
431             Value: 255
432
433       {_POSIX_LINK_MAX}
434             Maximum number of links to a single file.
435             Value: 8
436
437       {_POSIX_LOGIN_NAME_MAX}
438             The size of the storage required  for  a  login  name,  in  bytes
439             (including the terminating null).
440             Value: 9
441
442       {_POSIX_MAX_CANON}
443             Maximum number of bytes in a terminal canonical input queue.
444             Value: 255
445
446       {_POSIX_MAX_INPUT}
447             Maximum number of bytes allowed in a terminal input queue.
448             Value: 255
449
450       {_POSIX_MQ_OPEN_MAX}
451             The  number  of  message  queues  that  can  be open for a single
452             process.
453             Value: 8
454
455       {_POSIX_MQ_PRIO_MAX}
456             The maximum number of message priorities supported by the  imple‐
457             mentation.
458             Value: 32
459
460       {_POSIX_NAME_MAX}
461             Maximum  number  of bytes in a filename (not including the termi‐
462             nating null of a filename string).
463             Value: 14
464
465       {_POSIX_NGROUPS_MAX}
466             Maximum  number  of  simultaneous  supplementary  group  IDs  per
467             process.
468             Value: 8
469
470       {_POSIX_OPEN_MAX}
471             A  value  one  greater than the maximum value that the system may
472             assign to a newly-created file descriptor.
473             Value: 20
474
475       {_POSIX_PATH_MAX}
476             Minimum number the implementation will accept as the maximum num‐
477             ber of bytes in a pathname.
478             Value: 256
479
480       {_POSIX_PIPE_BUF}
481             Maximum  number  of  bytes  that  is guaranteed to be atomic when
482             writing to a pipe.
483             Value: 512
484
485       {_POSIX_RE_DUP_MAX}
486             The number of repeated occurrences of  a  BRE  permitted  by  the
487             regexec()  and  regcomp() functions when using the interval nota‐
488             tion {\(m,n\}; see Section 9.3.6, BREs Matching Multiple  Charac‐
489             ters.
490             Value: 255
491
492       {_POSIX_RTSIG_MAX}
493             The  number  of  realtime signal numbers reserved for application
494             use.
495             Value: 8
496
497       {_POSIX_SEM_NSEMS_MAX}
498             The number of semaphores that a process may have.
499             Value: 256
500
501       {_POSIX_SEM_VALUE_MAX}
502             The maximum value a semaphore may have.
503             Value: 32 767
504
505       {_POSIX_SIGQUEUE_MAX}
506             The number of queued signals that a process  may  send  and  have
507             pending at the receiver(s) at any time.
508             Value: 32
509
510       {_POSIX_SSIZE_MAX}
511             The value that can be stored in an object of type ssize_t.
512             Value: 32 767
513
514       {_POSIX_SS_REPL_MAX}
515             The number of replenishment operations that may be simultaneously
516             pending for a particular sporadic server scheduler.
517             Value: 4
518
519       {_POSIX_STREAM_MAX}
520             The number of streams that one process can have open at one time.
521             Value: 8
522
523       {_POSIX_SYMLINK_MAX}
524             The number of bytes in a symbolic link.
525             Value: 255
526
527       {_POSIX_SYMLOOP_MAX}
528             The number of symbolic links that can be traversed in the resolu‐
529             tion of a pathname in the absence of a loop.
530             Value: 8
531
532       {_POSIX_THREAD_DESTRUCTOR_ITERATIONS}
533             The number of attempts made to destroy a thread's thread-specific
534             data values on thread exit.
535             Value: 4
536
537       {_POSIX_THREAD_KEYS_MAX}
538             The number of data keys per process.
539             Value: 128
540
541       {_POSIX_THREAD_THREADS_MAX}
542             The number of threads per process.
543             Value: 64
544
545       {_POSIX_TIMER_MAX}
546             The per-process number of timers.
547             Value: 32
548
549       {_POSIX_TRACE_EVENT_NAME_MAX}
550             The length in bytes of a trace event name (not including the ter‐
551             minating null).
552             Value: 30
553
554       {_POSIX_TRACE_NAME_MAX}
555             The  length  in  bytes  of a trace generation version string or a
556             trace stream name (not including the terminating null).
557             Value: 8
558
559       {_POSIX_TRACE_SYS_MAX}
560             The number of trace streams that may simultaneously exist in  the
561             system.
562             Value: 8
563
564       {_POSIX_TRACE_USER_EVENT_MAX}
565             The number of user trace event type identifiers that may simulta‐
566             neously exist in a traced process, including the predefined  user
567             trace event POSIX_TRACE_UNNAMED_USER_EVENT.
568             Value: 32
569
570       {_POSIX_TTY_NAME_MAX}
571             The  size  of the storage required for a terminal device name, in
572             bytes (including the terminating null).
573             Value: 9
574
575       {_POSIX_TZNAME_MAX}
576             Maximum number of bytes supported for the name of a timezone (not
577             of the TZ variable).
578             Value: 6
579
580             Note:     The   length  given  by  {_POSIX_TZNAME_MAX}  does  not
581                       include the quoting  characters  mentioned  in  Section
582                       8.3, Other Environment Variables.
583
584       {_POSIX2_BC_BASE_MAX}
585             Maximum obase values allowed by the bc utility.
586             Value: 99
587
588       {_POSIX2_BC_DIM_MAX}
589             Maximum  number of elements permitted in an array by the bc util‐
590             ity.
591             Value: 2 048
592
593       {_POSIX2_BC_SCALE_MAX}
594             Maximum scale value allowed by the bc utility.
595             Value: 99
596
597       {_POSIX2_BC_STRING_MAX}
598             Maximum length of a string constant accepted by the bc utility.
599             Value: 1 000
600
601       {_POSIX2_CHARCLASS_NAME_MAX}
602             Maximum number of bytes in a character class name.
603             Value: 14
604
605       {_POSIX2_COLL_WEIGHTS_MAX}
606             Maximum number of weights that can be assigned to an entry of the
607             LC_COLLATE order keyword in the locale definition file; see Chap‐
608             ter 7, Locale.
609             Value: 2
610
611       {_POSIX2_EXPR_NEST_MAX}
612             Maximum number of expressions that can be nested within parenthe‐
613             ses by the expr utility.
614             Value: 32
615
616       {_POSIX2_LINE_MAX}
617             Unless  otherwise noted, the maximum length, in bytes, of a util‐
618             ity's input line (either standard input or  another  file),  when
619             the  utility  is  described  as processing text files. The length
620             includes room for the trailing <newline>.
621             Value: 2 048
622
623       {_POSIX2_RE_DUP_MAX}
624             Maximum number of repeated occurrences of  a  regular  expression
625             permitted  when  using the interval notation \{m,n\}; see Chapter
626             9, Regular Expressions.
627             Value: 255
628
629       {_XOPEN_IOV_MAX}
630             Maximum number of iovec structures that one process has available
631             for use with readv() or writev().
632             Value: 16
633
634       {_XOPEN_NAME_MAX}
635             Maximum  number  of bytes in a filename (not including the termi‐
636             nating null of a filename string).
637             Value: 255
638
639       {_XOPEN_PATH_MAX}
640             Minimum number the implementation will accept as the maximum num‐
641             ber of bytes in a pathname.
642             Value: 1024
643
644   Numerical Limits
645       The <limits.h> header shall define the following macros and, except for
646       {CHAR_BIT}, {LONG_BIT}, {MB_LEN_MAX}, and  {WORD_BIT},  they  shall  be
647       replaced  by expressions that have the same type as would an expression
648       that is an object of the corresponding type converted according to  the
649       integer promotions.
650
651       If  the  value of an object of type char is treated as a signed integer
652       when used in an expression, the value of {CHAR_MIN} is the same as that
653       of  {SCHAR_MIN}  and  the  value  of  {CHAR_MAX} is the same as that of
654       {SCHAR_MAX}.  Otherwise, the value of {CHAR_MIN} is 0 and the value  of
655       {CHAR_MAX} is the same as that of {UCHAR_MAX}.
656
657       {CHAR_BIT}
658             Number of bits in a type char.
659             Value: 8
660
661       {CHAR_MAX}
662             Maximum value for an object of type char.
663             Value: {UCHAR_MAX} or {SCHAR_MAX}
664
665       {CHAR_MIN}
666             Minimum value for an object of type char.
667             Value: {SCHAR_MIN} or 0
668
669       {INT_MAX}
670             Maximum value for an object of type int.
671             Minimum Acceptable Value: 2 147 483 647
672
673       {INT_MIN}
674             Minimum value for an object of type int.
675             Maximum Acceptable Value: −2 147 483 647
676
677       {LLONG_MAX}
678             Maximum value for an object of type long long.
679             Minimum Acceptable Value: +9223372036854775807
680
681       {LLONG_MIN}
682             Minimum value for an object of type long long.
683             Maximum Acceptable Value: −9223372036854775807
684
685       {LONG_BIT}
686             Number of bits in an object of type long.
687             Minimum Acceptable Value: 32
688
689       {LONG_MAX}
690             Maximum value for an object of type long.
691             Minimum Acceptable Value: +2 147 483 647
692
693       {LONG_MIN}
694             Minimum value for an object of type long.
695             Maximum Acceptable Value: −2 147 483 647
696
697       {MB_LEN_MAX}
698             Maximum number of bytes in a character, for any supported locale.
699             Minimum Acceptable Value: 1
700
701       {SCHAR_MAX}
702             Maximum value for an object of type signed char.
703             Value: +127
704
705       {SCHAR_MIN}
706             Minimum value for an object of type signed char.
707             Value: −128
708
709       {SHRT_MAX}
710             Maximum value for an object of type short.
711             Minimum Acceptable Value: +32 767
712
713       {SHRT_MIN}
714             Minimum value for an object of type short.
715             Maximum Acceptable Value: −32 767
716
717       {SSIZE_MAX}
718             Maximum value for an object of type ssize_t.
719             Minimum Acceptable Value: {_POSIX_SSIZE_MAX}
720
721       {UCHAR_MAX}
722             Maximum value for an object of type unsigned char.
723             Value: 255
724
725       {UINT_MAX}
726             Maximum value for an object of type unsigned.
727             Minimum Acceptable Value: 4 294 967 295
728
729       {ULLONG_MAX}
730             Maximum value for an object of type unsigned long long.
731             Minimum Acceptable Value: 18446744073709551615
732
733       {ULONG_MAX}
734             Maximum value for an object of type unsigned long.
735             Minimum Acceptable Value: 4 294 967 295
736
737       {USHRT_MAX}
738             Maximum value for an object of type unsigned short.
739             Minimum Acceptable Value: 65 535
740
741       {WORD_BIT}
742             Number of bits in an object of type int.
743             Minimum Acceptable Value: 32
744
745   Other Invariant Values
746       The <limits.h> header shall define the following symbolic constants:
747
748       {NL_ARGMAX}
749             Maximum  value  of n in conversion specifications using the "%n$"
750             sequence in calls to the printf() and scanf() families  of  func‐
751             tions.
752             Minimum Acceptable Value: 9
753
754       {NL_LANGMAX}
755             Maximum number of bytes in a LANG name.
756             Minimum Acceptable Value: 14
757
758       {NL_MSGMAX}
759             Maximum message number.
760             Minimum Acceptable Value: 32 767
761
762       {NL_SETMAX}
763             Maximum set number.
764             Minimum Acceptable Value: 255
765
766       {NL_TEXTMAX}
767             Maximum number of bytes in a message string.
768             Minimum Acceptable Value: {_POSIX2_LINE_MAX}
769
770       {NZERO}
771             Default process priority.
772             Minimum Acceptable Value: 20
773
774       The following sections are informative.
775

APPLICATION USAGE

777       None.
778

RATIONALE

780       A  request  was  made to reduce the value of {_POSIX_LINK_MAX} from the
781       value of 8 specified for it in the  POSIX.1‐1990  standard  to  2.  The
782       standard developers decided to deny this request for several reasons:
783
784        *  They  wanted to avoid making any changes to the standard that could
785           break conforming applications, and the requested change could  have
786           that effect.
787
788        *  The  use of multiple hard links to a file cannot always be replaced
789           with use of symbolic links. Symbolic links are semantically differ‐
790           ent  from hard links in that they associate a pathname with another
791           pathname rather than a pathname with a file. This has  implications
792           for access control, file permanence, and transparency.
793
794        *  The original standard developers had considered the issue of allow‐
795           ing for implementations that did not in general support hard links,
796           and decided that this would reduce consensus on the standard.
797
798       Systems  that  support historical versions of the development option of
799       the ISO POSIX‐2 standard retain the  name  {_POSIX2_RE_DUP_MAX}  as  an
800       alias for {_POSIX_RE_DUP_MAX}.
801
802       {PATH_MAX}
803             IEEE  PASC  Interpretation 1003.1 #15 addressed the inconsistency
804             in the standard with the definition of pathname and the  descrip‐
805             tion  of  {PATH_MAX}, allowing application developers to allocate
806             either {PATH_MAX} or {PATH_MAX}+1 bytes.  The  inconsistency  has
807             been  removed  by  correction  to  the  {PATH_MAX}  definition to
808             include the null character. With this change,  applications  that
809             previously allocated {PATH_MAX} bytes will continue to succeed.
810
811       {SYMLINK_MAX}
812             This  symbol  refers to space for data that is stored in the file
813             system, as opposed to {PATH_MAX} which is the length  of  a  name
814             that  can  be  passed to a function. In some existing implementa‐
815             tions, the pathnames pointed to by symbolic links are  stored  in
816             the  inodes  of  the links, so it is important that {SYMLINK_MAX}
817             not be constrained to be as large as {PATH_MAX}.
818

FUTURE DIRECTIONS

820       None.
821

SEE ALSO

823       Chapter 7, Locale, <stdio.h>, <unistd.h>
824
825       The System Interfaces volume of POSIX.1‐2008, Section 2.2, The Compila‐
826       tion Environment, fpathconf(), sysconf()
827
829       Portions  of  this text are reprinted and reproduced in electronic form
830       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
831       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
832       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
833       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
834       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
835       event of any discrepancy between this version and the original IEEE and
836       The Open Group Standard, the original IEEE and The Open Group  Standard
837       is  the  referee document. The original Standard can be obtained online
838       at http://www.unix.org/online.html .
839
840       Any typographical or formatting errors that appear  in  this  page  are
841       most likely to have been introduced during the conversion of the source
842       files to man page format. To report such errors,  see  https://www.ker
843       nel.org/doc/man-pages/reporting_bugs.html .
844
845
846
847IEEE/The Open Group                  2013                         limits.h(0P)
Impressum