2 .\" Copyright 1989 AT&T. Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LIMITS.H 3HEAD "Apr 8, 2004"
8 limits.h, limits \- implementation-defined constants
12 \fB#include <limits.h>\fR
18 The <\fBlimits.h\fR> header defines various symbolic names. Different
19 categories of names are described below.
22 The names represent various limits on resources that the implementation imposes
23 on applications. Symbolic constant names beginning with _POSIX can be found in
24 \fBunistd.h\fR(3HEAD).
27 Applications should not assume any particular value for a limit. An application
28 wishing to avail itself of the full amount of a resource available on an
29 implementation can make use of the value given in limits.h on that particular
30 implementation by using the symbolic names listed below. Many of the listed
31 limits are not invariant, and at runtime, the value of the limit might differ
32 from those given in this header, for the following reasons:
37 The limit is pathname-dependent.
43 The limit differs between the compile and runtime machines.
47 For these reasons, an application can use the \fBfpathconf\fR(2),
48 \fBpathconf\fR(2), and \fBsysconf\fR(3C) functions to determine the actual
49 value of a limit at runtime.
50 .SS "Runtime Invariant Values (Possibly Indeterminate)"
54 \fB\fBAIO_LISTIO_MAX\fR\fR
58 Maximum number of I/O operations in a single list I/O call supported by the
69 Maximum number of outstanding asynchronous I/O operations supported by the
76 \fB\fBAIO_PRIO_DELTA_MAX\fR\fR
80 The maximum amount by which a process can decrease its asynchronous I/O
81 priority level from its own scheduling priority.
91 Maximum length of argument to the \fBexec\fR(2) functions including environment
98 \fB\fBATEXIT_MAX\fR\fR
102 Maximum number of functions that can be registered with \fBatexit\fR(3C).
108 \fB\fBCHILD_MAX\fR\fR
112 Maximum number of simultaneous processes per real user ID.
122 Number of clock ticks per second returned by the \fBtimes\fR(2) function.
128 \fB\fBDELAYTIMER_MAX\fR\fR
132 Maximum number of timer expiration overruns.
138 \fB\fBHOST_NAME_MAX\fR\fR
142 Maximum length of a host name (not including the terminating null) as returned
143 from the \fBgethostname\fR(3C) function.
153 Maximum number of \fBiovec\fR structures that one process has available for use
154 with \fBread\fR(2) or \fBwrite\fR(2).
160 \fB\fBLOGIN_NAME_MAX\fR\fR
164 Maximum length of a login name.
170 \fB\fBMQ_OPEN_MAX\fR\fR
174 The maximum number of open message queue descriptors a process is allowed to
181 \fB\fBLOGIN_NAME_MAX\fR\fR
185 Maximum length of a login name.
191 \fB\fBMQ_OPEN_MAX\fR\fR
195 The maximum number of open message queue descriptors a process is allowed to
202 \fB\fBMQ_PRIO_MAX\fR\fR
206 The maximum number of message priorities supported by the implementation.
216 Maximum number of files that one process can have open at any one time.
226 Size in bytes of a page.
232 \fB\fBPAGE_SIZE\fR\fR
236 Equivalent to \fBPAGESIZE\fR. If either \fBPAGESIZE\fR or \fBPAGE_SIZE\fR is
237 defined, the other is defined with the same value.
247 The maximum number of significant bytes in a password, not including the
254 \fB\fBPTHREAD_DESTRUCTOR_ITERATIONS\fR\fR
258 Maximum number of attempts made to destroy a thread's thread-specific data
259 values on thread exit.
265 \fB\fBPTHREAD_KEYS_MAX\fR\fR
269 Maximum number of data keys that can be created by a process.
275 \fB\fBPTHREAD_STACK_MIN\fR\fR
279 Minimum size in bytes of thread stack storage.
285 \fB\fBPTHREAD_THREADS_MAX\fR\fR
289 Maximum number of threads that can be created per process.
295 \fB\fBRE_DUP_MAX\fR\fR
299 The number of repeated occurrences of a BRE permitted by the \fBregexec\fR(3C)
300 and \fBregcomp\fR(3C) functions when using the interval notation
301 {\e(\fIm\fR,\fIn\fR\e}.
307 \fB\fBRTSIG_MAX\fR\fR
311 Maximum number of realtime signals reserved for application use in this
318 \fB\fBSEM_NSEMS_MAX\fR\fR
322 Maximum number of semaphores that a process can have.
328 \fB\fBSEM_VALUE_MAX\fR\fR
332 The maximum value a semaphore can have.
338 \fB\fBSIGQUEUE_MAX\fR\fR
342 Maximum number of queued signals that a process can send and have pending at
343 the receiver(s) at any time.
349 \fB\fBSS_REPL_MAX\fR\fR
353 The maximum number of replenishment operations that may be simultaneously
354 pending for a particular sporadic server scheduler.
360 \fB\fBSTREAM_MAX\fR\fR
364 The number of streams that one process can have open at one time. If defined,
365 it has the same value as \fBFOPEN_MAX\fR.
371 \fB\fBSYMLOOP_MAX\fR\fR
375 Maximum number of symbolic links that can be reliably traversed in the
376 resolution of a pathname in the absence of a loop.
382 \fB\fBTIMER_MAX\fR\fR
386 Maximum number of timers per process supported by the implementation.
392 \fB\fBTRACE_EVENT_NAME_MAX\fR\fR
396 Maximum length of the trace event name.
402 \fB\fBTRACE_NAME_MAX\fR\fR
406 Maximum length of the trace generation version string or of the trace stream
413 \fB\fBTRACE_SYS_MAX\fR\fR
417 Maximum number of trace streams that may simultaneously exist in the system.
423 \fB\fBTRACE_USER_EVENT_MAX\fR\fR
427 Maximum number of user trace event type identifiers that may simultaneously
428 exist in a traced process, including the predefined user trace event
429 \fBPOSIX_TRACE_UNNAMED_USER_EVENT\fR.
435 \fB\fBTTY_NAME_MAX\fR\fR
439 Maximum length of terminal device name.
445 \fB\fBTZNAME_MAX\fR\fR
449 Maximum number of bytes supported for the name of a timezone (not of the TZ
453 .SS "Pathname Variable Values"
456 The values in the following list can be constants within an implementation or
457 can vary from one pathname to another. For example, file systems or directories
458 can have different characteristics. The value supported for a specific pathname
459 is provided by the \fBpathconf\fR(2) function.
463 \fB\fBFILESIZEBITS\fR\fR
466 Minimum number of bits needed to represent, as a signed integer value, the
467 maximum size of a regular file allowed in the specified directory.
476 Maximum number of links to a single file.
482 \fB\fBMAX_CANON\fR\fR
485 Maximum number of bytes in a terminal canonical input line.
491 \fB\fBMAX_INPUT\fR\fR
494 Minimum number of bytes for which space is available in a terminal input queue;
495 therefore, the maximum number of bytes a conforming application may require to
496 be typed as input before reading them.
505 Maximum number of bytes in a filename (not including terminating null).
514 Maximum number of bytes in a pathname, including the terminating null
524 Maximum number of bytes that is guaranteed to be atomic when writing to a pipe.
530 \fB\fBPOSIX_ALLOC_SIZE_MIN\fR\fR
533 Minimum number of bytes of storage actually allocated for any portion of a
540 \fB\fBPOSIX_REC_INCR_XFER_SIZE\fR\fR
543 Recommended increment for file transfer sizes between the
544 \fBPOSIX_REC_MIN_XFER_SIZE\fR and \fBPOSIX_REC_MAX_XFER_SIZE\fR values.
550 \fB\fBPOSIX_REC_MAX_XFER_SIZE\fR\fR
553 Maximum recommended file transfer size.
559 \fB\fBPOSIX_REC_MIN_XFER_SIZE\fR\fR
562 Minimum recommended file transfer size.
568 \fB\fBPOSIX_REC_XFER_ALIGN\fR\fR
571 Recommended file transfer buffer alignment.
577 \fB\fBSYMLINK_MAX\fR\fR
580 Maximum number of bytes in a symbolic link.
583 .SS "Runtime Increasable Values"
586 The magnitude limitations in the following list are fixed by specific
587 implementations. An application should assume that the value supplied by
588 <\fBlimits.h\fR> in a specific implementation is the minimum that pertains
589 whenever the application is run under that implementation. A specific instance
590 of a specific implementation can increase the value relative to that supplied
591 by <\fBlimits.h\fR> for that implementation. The actual value supported by a
592 specific instance is provided by the \fBsysconf\fR(3C) function.
596 \fB\fBBC_BASE_MAX\fR\fR
599 Maximum obase values allowed by the \fBbc\fR(1) utility.
605 \fB\fBBC_DIM_MAX\fR\fR
608 Maximum number of elements permitted in an array by the \fBbc\fR utility.
614 \fB\fBBC_SCALE_MAX\fR\fR
617 Maximum scale value allowed by the \fBbc\fR utility.
623 \fB\fBBC_STRING_MAX\fR\fR
626 Maximum length of a string constant accepted by the \fBbc\fR utility.
632 \fB\fBCHARCLASS_NAME_MAX\fR\fR
635 Maximum number of bytes in a character class name.
641 \fB\fBCOLL_WEIGHTS_MAX\fR\fR
644 Maximum number of weights that can be assigned to an entry of the
645 \fBLC_COLLATE\fR order keyword in the locale definition file.
651 \fB\fBEXPR_NEST_MAX\fR\fR
654 Maximum number of expressions that can be nested within parentheses by the
655 \fBexpr\fR(1) utility.
661 \fB\fBEXPR_NEST_MAX\fR\fR
664 Maximum number of expressions that can be nested within parentheses by the
674 Unless otherwise noted, the maximum length, in bytes, of a utility's input line
675 (either standard input or another file), when the utility is described as
676 processing text files. The length includes room for the trailing <newline>.
682 \fB\fBNGROUPS_MAX\fR\fR
685 Maximum number of simultaneous supplementary group IDs per process.
691 \fB\fBRE_DUP_MAX\fR\fR
694 Maximum number of repeated occurrences of a regular expression permitted when
695 using the interval notation \e{\fIm\fR,\fIn\fR\e}.
701 The symbolic constants in the following list are symbolic names for the most
702 restrictive value for certain features on an implementation supporting the
707 \fB\fB_POSIX_CLOCKRES_MIN\fR\fR
710 The resolution of the \fBCLOCK_REALTIME\fR clock, in nanoseconds.
716 The symbolic constants in the following list are symbolic names for the most
717 restrictive value for certain features on an implementation conforming to
718 various POSIX and Single Unix Specification requirements. See
723 \fB\fB_POSIX_AIO_LISTIO_MAX\fR\fR
727 The number of I/O operations that can be specified in a list I/O call.
733 \fB\fB_POSIX_AIO_MAX\fR\fR
737 The number of outstanding asynchronous I/O operations.
743 \fB\fB_POSIX_ARG_MAX\fR\fR
747 Maximum length of argument to the \fBexec\fR(2) functions including environment
754 \fB\fB_POSIX_CHILD_MAX\fR\fR
758 Maximum number of simultaneous processes per real user ID.
764 \fB\fB_POSIX_DELAYTIMER_MAX\fR\fR
768 The number of timer expiration overruns.
774 \fB\fB_POSIX_HOST_NAME_MAX\fR\fR
778 Maximum length of a host name (not including the terminating null) as returned
779 from the \fBgethostname\fR(3C) function.
785 \fB\fB_POSIX_LINK_MAX\fR\fR
789 Maximum number of links to a single file.
795 \fB\fB_POSIX_LOGIN_NAME_MAX\fR\fR
799 The size of the storage required for a login name, in bytes, including the
806 \fB\fB_POSIX_MAX_CANON\fR\fR
810 Maximum number of bytes in a terminal canonical input queue.
816 \fB\fB_POSIX_MAX_INPUT\fR\fR
820 Maximum number of bytes allowed in a terminal input queue.
826 \fB\fB_POSIX_MQ_OPEN_MAX\fR\fR
830 The number of message queues that can be open for a single process.
836 \fB\fB_POSIX_MQ_PRIO_MAX\fR\fR
840 The maximum number of message priorities supported by the implementation.
846 \fB\fB_POSIX_NAME_MAX\fR\fR
850 Maximum number of bytes in a filename (not including terminating null).
856 \fB\fB_POSIX_NGROUPS_MAX\fR\fR
860 Maximum number of simultaneous supplementary group IDs per process.
866 \fB\fB_POSIX_OPEN_MAX\fR\fR
870 Maximum number of files that one process can have open at any one time.
876 \fB\fB_POSIX_PATH_MAX\fR\fR
880 Maximum number of bytes in a pathname.
886 \fB\fB_POSIX_PIPE_BUF\fR\fR
890 Maximum number of bytes that is guaranteed to be atomic when writing to a pipe.
896 \fB\fB_POSIX_RE_DUP_MAX\fR\fR
900 The number of repeated occurrences of a BRE permitted by the \fBregexec()\fR
901 and \fBregcomp()\fR functions when using the interval notation
902 {\e(\fIm\fR,\fIn\fR\e}
908 \fB\fB_POSIX_RTSIG_MAX\fR\fR
912 The number of realtime signal numbers reserved for application use.
918 \fB\fB_POSIX_SEM_NSEMS_MAX\fR\fR
922 The number of semaphores that a process can have.
928 \fB\fB_POSIX_SEM_VALUE_MAX\fR\fR
932 The maximum value a semaphore can have.
938 \fB\fB_POSIX_SIGQUEUE_MAX\fR\fR
942 The number of queued signals that a process can send and have pending at the
943 receiver(s) at any time.
949 \fB\fB_POSIX_SSIZE_MAX\fR\fR
953 The value that can be stored in an object of type \fBssize_t\fR.
959 \fB\fB_POSIX_STREAM_MAX\fR\fR
963 The number of streams that one process can have open at one time.
969 \fB\fB_POSIX_SS_REPL_MAX\fR\fR
973 The number of replenishment operations that can be simultaneously pending for a
974 particular sporadic server scheduler.
980 \fB\fB_POSIX_SYMLINK_MAX\fR\fR
984 The number of bytes in a symbolic link.
990 \fB\fB_POSIX_SYMLOOP_MAX\fR\fR
994 The number of symbolic links that can be traversed in the resolution of a
995 pathname in the absence of a loop.
1001 \fB\fB_POSIX_THREAD_DESTRUCTOR_ITERATIONS\fR\fR
1005 The number of attempts made to destroy a thread's thread-specific data values
1012 \fB\fB_POSIX_THREAD_KEYS_MAX\fR\fR
1016 The number of data keys per process.
1022 \fB\fB_POSIX_THREAD_THREADS_MAX\fR\fR
1026 The number of threads per process.
1032 \fB\fB_POSIX_TIMER_MAX\fR\fR
1036 The per-process number of timers.
1042 \fB\fB_POSIX_TRACE_EVENT_NAME_MAX\fR\fR
1046 The length in bytes of a trace event name.
1052 \fB\fB_POSIX_TRACE_NAME_MAX\fR\fR
1056 The length in bytes of a trace generation version string or a trace stream
1063 \fB\fB_POSIX_TRACE_SYS_MAX\fR\fR
1067 The number of trace streams that can simultaneously exist in the system.
1073 \fB\fB_POSIX_TRACE_USER_EVENT_MAX\fR\fR
1077 The number of user trace event type identifiers that may simultaneously exist
1078 in a traced process, including the predefined user trace event
1079 \fBPOSIX_TRACE_UNNAMED_USER_EVENT\fR.
1085 \fB\fB_POSIX_TTY_NAME_MAX\fR\fR
1089 The size of the storage required for a terminal device name, in bytes,
1090 including the terminating null.
1096 \fB\fB_POSIX_TZNAME_MAX\fR\fR
1100 Maximum number of bytes supported for the name of a timezone (not of the TZ
1107 \fB\fB_POSIX2_BC_BASE_MAX\fR\fR
1111 Maximum obase values allowed by the \fBbc\fR utility.
1117 \fB\fB_POSIX2_BC_DIM_MAX\fR\fR
1121 Maximum number of elements permitted in an array by the \fBbc\fR utility.
1127 \fB\fB_POSIX2_BC_SCALE_MAX\fR\fR
1131 Maximum scale value allowed by the \fBbc\fR utility.
1137 \fB\fB_POSIX2_BC_STRING_MAX\fR\fR
1141 Maximum length of a string constant accepted by the \fBbc\fR utility.
1147 \fB\fB_POSIX2_CHARCLASS_NAME_MAX\fR\fR
1151 Maximum number of bytes in a character class name.
1157 \fB\fB_POSIX2_COLL_WEIGHTS_MAX\fR\fR
1161 Maximum number of weights that can be assigned to an entry of the
1162 \fBLC_COLLATE\fR order keyword in the locale definition file.
1168 \fB\fB_POSIX2_EXPR_NEST_MAX\fR\fR
1172 Maximum number of expressions that can be nested within parentheses by the
1179 \fB\fB_POSIX2_LINE_MAX\fR\fR
1183 Unless otherwise noted, the maximum length, in bytes, of a utility's input line
1184 (either standard input or another file), when the utility is described as
1185 processing text files. The length includes room for the trailing <newline>.
1191 \fB\fB_POSIX2_RE_DUP_MAX\fR\fR
1195 Maximum number of repeated occurrences of a regular expression permitted when
1196 using the interval notation \e{\fIm\fR,\fIn\fR\e}.
1202 \fB\fB_XOPEN_IOV_MAX\fR\fR
1206 Maximum number of \fBiovec\fR structures that one process has available for use
1207 with \fBread\fR(2) or \fBwrite\fR(2).
1213 \fB\fB_XOPEN_NAME_MAX\fR\fR
1217 Maximum number of bytes in a filename (not including the terminating null).
1223 \fB\fB_XOPEN_PATH_MAX\fR\fR
1227 Maximum number of bytes in a pathname.
1230 .SS "Numerical Limits"
1233 The values in the following lists shall be defined in <\fBlimits.h\fR> and are
1234 constant expressions suitable for use in \fB#if\fR preprocessing directives.
1235 Moreover, except for \fBCHAR_BIT\fR, \fBDBL_DIG\fR, \fBDBL_MAX\fR,
1236 \fBFLT_DIG\fR, \fBFLT_MAX\fR, \fBLONG_BIT\fR, \fBWORD_BIT\fR, and
1237 \fBMB_LEN_MAX\fR, the symbolic names are defined as expressions of the correct
1241 If the value of an object of type \fBchar\fR is treated as a signed integer
1242 when used in an expression, the value of \fBCHAR_MIN\fR is the same as that of
1243 \fBSCHAR_MIN\fR and the value of \fBCHAR_MAX\fR is the same as that of
1244 \fBSCHAR_MAX\fR. Otherwise, the value of \fBCHAR_MIN\fR is 0 and the value of
1245 \fBCHAR_MAX\fR is the same as that of \fBUCHAR_MAX\fR.
1249 \fB\fBCHAR_BIT\fR\fR
1252 Number of bits in a type \fBchar\fR.
1258 \fB\fBCHAR_MAX\fR\fR
1261 Maximum value of type \fBchar\fR.
1267 \fB\fBCHAR_MIN\fR\fR
1270 Minimum value of type \fBchar\fR.
1279 Digits of precision of type \fBdouble\fR.
1288 Maximum decimal value of a \fBdouble\fR.
1297 Minimum decimal value of a \fBdouble\fR.
1306 Digits of precision of type \fBfloat\fR.
1315 Maximum decimal value of a \fBfloat\fR.
1324 Minimum decimal value of a \fBfloat\fR.
1333 Minimum value of type \fBint\fR.
1342 Maximum value of an \fBint\fR.
1348 \fB\fBLLONG_MIN\fR\fR
1351 Minimum value of type \fBlong long\fR.
1357 \fB\fBLLONG_MAX\fR\fR
1360 Maximum value of type \fBlong long\fR.
1366 \fB\fBLONG_BIT\fR\fR
1369 Number of bits in a \fBlong\fR.
1375 \fB\fBLONG_MIN\fR\fR
1378 Minimum value of type \fBlong\fR.
1384 \fB\fBLONG_MAX\fR\fR
1387 Maximum value of a \fBlong\fR.
1393 \fB\fBMB_LEN_MAX\fR\fR
1396 Maximum number of bytes in a character, for any supported locale.
1402 \fB\fBSCHAR_MIN\fR\fR
1405 Minimum value of type \fBsigned char\fR.
1411 \fB\fBSCHAR_MAX\fR\fR
1414 Maximum value of type \fBsigned char\fR.
1420 \fB\fBSHRT_MIN\fR\fR
1423 Minimum value of type \fBshort\fR.
1429 \fB\fBSHRT_MAX\fR\fR
1432 Maximum value of type \fBshort\fR.
1438 \fB\fBSSIZE_MAX\fR\fR
1441 Maximum value of an object of type \fBssize_t\fR.
1450 Minimum number of unique filename generated by \fBtmpnam\fR(3C). Maximum number
1451 of times an application can call \fBtmpnam()\fR reliably.
1457 \fB\fBUCHAR_MAX\fR\fR
1460 Maximum value of type \fBunsigned char\fR.
1466 \fB\fBUINT_MAX\fR\fR
1469 Maximum value of type \fBunsigned\fR.
1475 \fB\fBULLONG_MAX\fR\fR
1478 Maximum value of type unsigned \fBlong long\fR.
1484 \fB\fBULONG_MAX\fR\fR
1487 Maximum value of type \fBunsigned long\fR.
1493 \fB\fBUSHRT_MAX\fR\fR
1496 Maximum value for a type \fBunsigned short\fR.
1502 \fB\fBWORD_BIT\fR\fR
1505 Number of bits in a word or type \fBint\fR.
1508 .SS "Other Invariant Values"
1511 The following constants are defined in <\fBlimits.h\fR>.
1515 \fB\fBCHARCLASS_NAME_MAX\fR\fR
1518 Maximum number of bytes in a character class name.
1524 \fB\fBLOGNAME_MAX\fR\fR
1527 The maximum number of bytes supported in a user's login name.
1533 \fB\fBNL_ARGMAX\fR\fR
1536 Maximum value of digit in calls to the \fBprintf\fR(3C) and \fBscanf\fR(3C)
1543 \fB\fBNL_LANGMAX\fR\fR
1546 Maximum number of bytes in a \fBLANG\fR name.
1552 \fB\fBNL_MSGMAX\fR\fR
1555 Maximum message number.
1564 Maximum number of bytes in an N-to-1 collation mapping.
1570 \fB\fBNL_SETMAX\fR\fR
1579 \fB\fBNL_TEXTMAX\fR\fR
1582 Maximum number of bytes in a message string.
1591 Default process priority.
1597 \fBfpathconf\fR(2), \fBpathconf\fR(2), \fBsysconf\fR(3C), \fBstandards\fR(5)