1limits.h(3HEAD)                     Headers                    limits.h(3HEAD)
2
3
4

NAME

6       limits.h, limits - implementation-defined constants
7

SYNOPSIS

9       #include <limits.h>
10
11

DESCRIPTION

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

SEE ALSO

800       fpathconf(2), pathconf(2), sysconf(3C), standards(5)
801
802
803
804SunOS 5.11                       8 April 2004                  limits.h(3HEAD)
Impressum