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