Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ limits(4) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fpathconf(2)

pathconf(2)

sysconf(3C)

lfs(5)

limits(4)                                                         limits(4)

NAME
     limits - implementation-dependent constants

SYNOPSIS
     #include <limits.h>

DESCRIPTION
     The limits.h header defines various symbolic names. Different
     categories of names are described in the tables below.

     The names represent various limits on resources that the system
     imposes on applications.

     Implementations may choose any appropriate value for each limit, pro-
     vided it is not more restrictive than the values listed in the column
     headed "Minimum Acceptable Value" in the table below. Symbolic con-
     stant names beginning with POSIX may be found in unistd(4).

     Applications should not assume any particular value for a limit. To
     achieve maximum portability, an application should not require more
     resource than the quantity listed in the "Minimum Acceptable Value"
     column. However, an application wishing to avail itself of the full
     amount of a resource available on an implementation may make use of
     the value given in limits.h on that particular system, by using the
     symbolic names listed in the first column of the table. It should be
     noted, however, that many of the listed limits are not invariant, and
     at run time, the value of the limit may differ from those given in
     this header, for the following reasons:

     -  the limit is pathname-dependent

     -  the limit differs between the compile and run-time machines.

     For these reasons, an application may use the fpathconf(2),
     pathconf(2) and sysconf(3C) functions to determine the actual value of
     a limit at run time.

     The items in the list ending in MIN give the most negative values
     that the mathematical types are guaranteed to be capable of represent-
     ing. Numbers of a more negative value may be supported on some sys-
     tems, as indicated by the limits.h header on the system, but applica-
     tions requiring such numbers are not guaranteed to be portable to all
     systems.

   Run-time Invariant Values (Possibly Indeterminate)

     A definition of one of the symbolic names in the following table will
     be omitted from limits.h on specific implementations where the corre-
     sponding value is equal to or greater than the stated minimum, but is
     indeterminate.





Page 1                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

     This might depend on the amount of available memory space on a
     specific instance of a specific implementation. The actual value sup-
     ported by a specific instance will be provided by the sysconf() func-
     tion.
     _______________________________________________________________________
    |            |                                    |  Minimum           |
    | Name       |  Description                       |  Acceptable Value  |
    |____________|____________________________________|____________________|
    | ARGMAX    |  Maximum length of argument to the |  POSIXARGMAX    |
    |            |  exec functions including environ- |                    |
    |            |  ment data.                        |                    |
    |____________|____________________________________|____________________|
    | ATEXITMAX |  Maximum number of functions that  |  32                |
    |            |  may be registered with atexit().  |                    |
    |____________|____________________________________|____________________|
    | CHILDMAX  |  Maximum number of simultaneous    |  25                |
    |            |  processes per real user ID.       |                    |
    |____________|____________________________________|____________________|
    | IOVMAX    |  Maximum number of iovec structures|  XOPENIOVMAX    |
    |            |  that one process has available for|                    |
    |            |  use with readv() or writev().     |                    |
    |____________|____________________________________|____________________|
    | OPENMAX   |  Maximum number of files that one  |  20                |
    |            |  process can have open at any one  |                    |
    |            |  time.                             |                    |
    |____________|____________________________________|____________________|
    | PAGESIZE   |  Size in bytes of a page.          |  1                 |
    |____________|____________________________________|____________________|
    | PAGESIZE  |  Same as PAGESIZE. If either       |                    |
    |            |  PAGESIZE or PAGESIZE is defined, |                    |
    |            |  the other will be defined with the|                    |
    |            |  same value.                       |                    |
    |____________|____________________________________|____________________|
    | PASSMAX   |  Maximum number of significant     |  8                 |
    |            |  bytes in a password (not including|                    |
    |            |  terminating null).                |                    |
    |____________|____________________________________|____________________|
    | STREAMMAX |  The number of streams that one    |  POSIXSTREAMMAX |
    |            |  process can have open at one time.|                    |
    |            |  If defined, it has the same value |                    |
    |            |  as FOPENMAX [see stdio(3S)].     |                    |
    |____________|____________________________________|____________________|
    | TZNAMEMAX |  Maximum number of bytes supported |  POSIXTZNAMEMAX |
    |            |  for the name of a time zone (not  |                    |
    |            |  the TZ variable).                 |                    |
    |____________|____________________________________|____________________|








Page 2                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

   Pathname Variable Values

     The values in the following table may be constants within an implemen-
     tation or may vary from one pathname to another. For example, file
     systems or directories may have different characteristics.

     A definition of one of the values will be omitted from the limits.h on
     specific implementations where the corresponding value is equal to or
     greater than the stated minimum, but where the value can vary depend-
     ing on the file to which it is applied. The actual value supported for
     a specific pathname will be provided by the pathconf() function.
     _______________________________________________________________________
    |              |                                  |  Minimum           |
    | Name         |  Description                     |  Acceptable Value  |
    |______________|__________________________________|____________________|
    | FILESIZEBITS |  Minimum number of bits needed to|  *                 |
    |              |  represent, as a signed integer  |                    |
    |              |  value, the maximum size of a    |                    |
    |              |  regular file allowed in the     |                    |
    |              |  specified directory.            |                    |
    |______________|__________________________________|____________________|
    | LINKMAX     |  Maximum number of links to a    |  POSIXLINKMAX   |
    |              |  single file.                    |                    |
    |______________|__________________________________|____________________|
    | MAXCANON    |  Maximum number of bytes in a    |  POSIXMAXCANON  |
    |              |  terminal canonical input line.  |                    |
    |______________|__________________________________|____________________|
    | MAXINPUT    |  Minimum number of bytes for     |  POSIXMAXINPUT  |
    |              |  which space will be available in|                    |
    |              |  a terminal input queue; there-  |                    |
    |              |  fore, the maximum number of     |                    |
    |              |  bytes a portable application may|                    |
    |              |  require to typed as input before|                    |
    |              |  reading them.                   |                    |
    |______________|__________________________________|____________________|
    | NAMEMAX     |  Maximum number of bytes in a    |  POSIXNAMEMAX   |
    |              |  filename, (not including ter-   |                    |
    |              |  minating null).                 |                    |
    |______________|__________________________________|____________________|
    | PATHMAX     |  Maximum number of bytes in a    |  POSIXPATHMAX   |
    |              |  pathname, including the ter-    |                    |
    |              |  minating null character.        |                    |
    |______________|__________________________________|____________________|
    | PIPEBUF     |  Maximum number of bytes that is |  POSIXPIPEBUF   |
    |              |  guaranteed to be atomic when    |                    |
    |              |  writing to a pipe.              |                    |
    |______________|__________________________________|____________________|







Page 3                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

   Run-time Increasable Values

     The magnitude limitations in the following table will be fixed by
     specific implementations. An application should assume that the value
     supplied by limits.h in a specific implementation is the minimum that
     pertains whenever the application is run under that implementation. A
     specific instance of a specific implementation may increase the value
     relative to that supplied by limits.h for that implementation. The
     actual value supported by a specific instance will be provided by the
     sysconf() function.
     ______________________________________________________________________
    |                  |                      |  Minimum                  |
    | Name             |  Description         |  Acceptable Value         |
    |__________________|______________________|___________________________|
    | BCBASEMAX      |  Maximum obase values|  POSIX2BCBASEMAX      |
    |                  |  allowed by the bc   |                           |
    |                  |  utility.            |                           |
    |__________________|______________________|___________________________|
    | BCBASEMAX      |  Maximum number of   |  POSIX2BCDIMMAX       |
    |                  |  elements permitted  |                           |
    |                  |  in an array by the  |                           |
    |                  |  bc utility.         |                           |
    |__________________|______________________|___________________________|
    | BCSCALEMAX     |  Maximum scale value |  POSIX2BCSCALEMAX     |
    |                  |  allowed by the bc   |                           |
    |                  |  utility.            |                           |
    |__________________|______________________|___________________________|
    | BCSTRINGMAX    |  Maximum length of a |  POSIX2BCSTRINGMAX    |
    |                  |  string constant     |                           |
    |                  |  accepted by the bc  |                           |
    |                  |  utility.            |                           |
    |__________________|______________________|___________________________|
    | COLLWEIGHTSMAX |  Maximum number of   |  POSIX2COLLWEIGHTSMAX |
    |                  |  weights that can be |                           |
    |                  |  assigned to an entry|                           |
    |                  |  of the LCCOLLATE   |                           |
    |                  |  order keyword in the|                           |
    |                  |  locale definition   |                           |
    |                  |  file.               |                           |
    |__________________|______________________|___________________________|
    | EXPRNESTMAX    |  Maximum number of   |  POSIX2EXPRNESTMAX    |
    |                  |  expressions that can|                           |
    |                  |  be nested within    |                           |
    |                  |  parentheses by the  |                           |
    |                  |  expr utility.       |                           |
    |__________________|______________________|___________________________|








Page 4                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

     ______________________________________________________________________
    |                  |                      |  Minimum                  |
    | Name             |  Description         |  Acceptable Value         |
    |__________________|______________________|___________________________|
    | LINEMAX         |  Unless otherwise    |  POSIX2LINEMAX         |
    |                  |  noted, the maximum  |                           |
    |                  |  length, in bytes, of|                           |
    |                  |  a utility's input   |                           |
    |                  |  line (either stan-  |                           |
    |                  |  dard input or       |                           |
    |                  |  another file), when |                           |
    |                  |  the utility is      |                           |
    |                  |  described as pro-   |                           |
    |                  |  cessing text files. |                           |
    |                  |  The length includes |                           |
    |                  |  room for the trail- |                           |
    |                  |  ing newline.        |                           |
    |__________________|______________________|___________________________|
    | NGROUPSMAX      |  Maximum number of   |  8                        |
    |                  |  simultaneous supple-|                           |
    |                  |  mentary group IDs   |                           |
    |                  |  per process.        |                           |
    |__________________|______________________|___________________________|
    | REDUPMAX       |  Maximum number of   |  POSIX2REDUPMAX       |
    |                  |  repeated occurrences|                           |
    |                  |  of a regular expres-|                           |
    |                  |  sion permitted when |                           |
    |                  |  using the interval  |                           |
    |                  |  notation \{m,n\}.   |                           |
    |__________________|______________________|___________________________|
























Page 5                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

   Minimum Values

     The symbolic constants in the following table are defined in limits.h
     with the values shown. These are symbolic names for the most restric-
     tive value for certain features on a system conforming to this docu-
     ment. Related symbolic constants are defined elsewhere in this docu-
     ment which reflect the actual implementation and which need not be as
     restrictive. A conforming implementation will provide values at least
     this large. A portable application must not require a larger value for
     correct operation.
     ______________________________________________________________________
    | Name                     |  Description                    |  Value |
    |__________________________|_________________________________|________|
    | POSIXARGMAX           |  Maximum length of argument to  |  4096  |
    |                          |  the exec functions including   |        |
    |                          |  environment data.              |        |
    |__________________________|_________________________________|________|
    | POSIXCHILDMAX         |  Maximum number of simultaneous |  6     |
    |                          |  processes per real user ID.    |        |
    |__________________________|_________________________________|________|
    | POSIXLINKMAX          |  Maximum number of links to a   |  8     |
    |                          |  single file.                   |        |
    |__________________________|_________________________________|________|
    | POSIXMAXCANON         |  Maximum number of bytes in a   |  255   |
    |                          |  terminal canonical input queue.|        |
    |__________________________|_________________________________|________|
    | POSIXMAXINPUT         |  Maximum number of bytes allowed|  255   |
    |                          |  in a terminal input queue.     |        |
    |__________________________|_________________________________|________|
    | POSIXNAMEMAX          |  Maximum number of bytes in a   |  14    |
    |                          |  file name (not including ter-  |        |
    |                          |  minating null).                |        |
    |__________________________|_________________________________|________|
    | POSIXNGROUPSMAX       |  Maximum number of simultaneous |  0     |
    |                          |  supplementary group IDs per    |        |
    |                          |  process.                       |        |
    |__________________________|_________________________________|________|
    | POSIXOPENMAX          |  Maximum number of files that   |  16    |
    |                          |  one process can have open at   |        |
    |                          |  any one time.                  |        |
    |__________________________|_________________________________|________|
    | POSITPATHMAX          |  Maximum number of bytes in a   |  16    |
    |                          |  pathname.                      |        |
    |__________________________|_________________________________|________|










Page 6                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

     ______________________________________________________________________
    | Name                     |  Description                    |  Value |
    |__________________________|_________________________________|________|
    | POSIXPIPEBUF          |  Maximum number of bytes that is|  512   |
    |                          |  guaranteed to be atomic when   |        |
    |                          |  writing to a pipe.             |        |
    |__________________________|_________________________________|________|
    | POSIXSSIZEMAX         |  The value that can be stored in|  32767 |
    |                          |  an object of type ssizet.     |        |
    |__________________________|_________________________________|________|
    | POSIXSTREAMMAX        |  The number of streams that one |  8     |
    |                          |  process can have open at one   |        |
    |                          |  time.                          |        |
    |__________________________|_________________________________|________|
    | POSIXTZNAMEMAX        |  Maximum number of bytes sup-   |  3     |
    |                          |  ported for the name of a time  |        |
    |                          |  zone (not of TZ variable).     |        |
    |__________________________|_________________________________|________|
    | POSIX2BCBASEMAX      |  Maximum obase values allowed by|  99    |
    |                          |  the bc utility.                |        |
    |__________________________|_________________________________|________|
    | POSIX2BCDIMMAX       |  Maximum number of elements per-|  2048  |
    |                          |  mitted in an array by the bc   |        |
    |                          |  utility.                       |        |
    |__________________________|_________________________________|________|
    | POSIX2BCBASEMAX      |  Maximum scale value allowed by |  99    |
    |                          |  the bc utility.                |        |
    |__________________________|_________________________________|________|
    | POSIX2BCSTRINGMAX    |  Maximum length of a string con-|  1000  |
    |                          |  stant accepted by the bc util- |        |
    |                          |  ity.                           |        |
    |__________________________|_________________________________|________|
    | POSIX2COLLWEIGHTSMAX |  Maximum number of weights that |  2     |
    |                          |  can be assigned to an entry of |        |
    |                          |  the LCCOLLATE order keyword in|        |
    |                          |  the locale definition file.    |        |
    |__________________________|_________________________________|________|
    | POSIX2EXPRNESTMAX    |  Maximum number of expressions  |  32    |
    |                          |  that can be nested within      |        |
    |                          |  parentheses by the expr util-  |        |
    |                          |  ity.                           |        |
    |__________________________|_________________________________|________|












Page 7                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

     ______________________________________________________________________
    | Name                     |  Description                    |  Value |
    |__________________________|_________________________________|________|
    | POSIX2LINEMAX         |  Unless otherwise noted, the    |  2048  |
    |                          |  maximum length, in bytes, of a |        |
    |                          |  utility's input line (either   |        |
    |                          |  standard input or another      |        |
    |                          |  file), when the utility is     |        |
    |                          |  described as processing text   |        |
    |                          |  files. The length includes room|        |
    |                          |  for the trailing newline.      |        |
    |__________________________|_________________________________|________|
    | POSIX2REDUPMAX       |  Maximum number of repeated     |  255   |
    |                          |  occurrences of a regular       |        |
    |                          |  expression permitted when using|        |
    |                          |  the interval notation \{m,n}\. |        |
    |__________________________|_________________________________|________|
    | XOPENIOVMAX           |  Maximum number of iovec struc- |  16    |
    |                          |  tures that one process has     |        |
    |                          |  available for use with readv() |        |
    |                          |  or writev().                   |        |
    |__________________________|_________________________________|________|

   Numerical limits

     The values in the following tables are defined in limits.h and will be
     constant expressions suitable for use in #if preprocessing directives.
     Moreover, except for CHARBIT, DBLDIG, DBLMAX, FLZDIG, FLTMAX,
     LONGBIT, WORDBIT and MBLENMAX, the symbolic names will be defined
     as expressions of the correct type.

     If the value of an object of type char is treated as a signed integer
     when used in an expression, the value of CHARMIN is the same as that
     of SCHARMIN and the value of CHARMAX is the same as that of
     SCHARMAX. Otherwise, the value of CHARMIN is 0 and the value of
     CHARMAX is the same as that of UCHARMAX.
     ________________________________________________________________________
    |             |                                 | Minimum               |
    | Name        | Description                     | Acceptable Value      |
    |_____________|_________________________________|_______________________|
    | CHARBIT    | Number of bits in a type char.  | 8                     |
    |_____________|_________________________________|_______________________|
    | CHARMAX    | Maximum value of a type char.   | UCHARMAX or SCHARMAX|
    |_____________|_________________________________|_______________________|
    | DBLDIG     | Digits of precision of a type   | 10                    |
    |             | double.                         |                       |
    |_____________|_________________________________|_______________________|
    | DBLMAX     | Maximum value of a type double. | 1E + 37               |
    |_____________|_________________________________|_______________________|





Page 8                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

     _________________________________________________________________________
    |              |                                 | Minimum               |
    | Name         | Description                     | Acceptable Value      |
    |______________|_________________________________|_______________________|
    | FLTDIG      | Digits of precision of a type   | 6                     |
    |              | float.                          |                       |
    |______________|_________________________________|_______________________|
    | FLTMAX      | Maximum value of a float.       | 1E + 37               |
    |______________|_________________________________|_______________________|
    | INTMAX      | Maximum value of an int.        | 2147483647            |
    |______________|_________________________________|_______________________|
    | LONGBIT     | Number of bits in a long int    | 32                    |
    |              | (32-bit system).                |                       |
    | LONGBIT     | Number of bits in a long int    | 64                    |
    |              | (64-bit system).                |                       |
    |______________|_________________________________|_______________________|
    | LONGMAX     | Maximum value of a long int (32-| 2147483647            |
    |              | bit system).                    |                       |
    | LONGMAX     | Maximum value of a long int (64-| 9223372036854775807   |
    |              | bit system).                    |                       |
    |______________|_________________________________|_______________________|
    | LONGLONGMAX | Maximum value of a long int.    | 9223372036854775807   |
    |______________|_________________________________|_______________________|
    | MBLENMAX   | Maximum number of bytes in a    | 1                     |
    |              | character, for any supported    |                       |
    |              | locale.                         |                       |
    |______________|_________________________________|_______________________|
    | SCHARMAX    | Maximum value of a type signed  | 127                   |
    |              | char.                           |                       |
    |______________|_________________________________|_______________________|
    | SHRTMAX     | Maximum value of a type short.  | 32767                 |
    |______________|_________________________________|_______________________|
    | SSIZEMAX    | Maximum value of an object of   | POSIXSSIZEMAX      |
    |              | type ssizet.                   |                       |
    |______________|_________________________________|_______________________|
    | UCHARMAX    | Maximum value of a type unsigned| 255                   |
    |              | char.                           |                       |
    |______________|_________________________________|_______________________|
    | UINTMAX     | Maximum value of a type unsigned| 4294967295            |
    |              | int.                            |                       |
    |______________|_________________________________|_______________________|
    | ULONGMAX    | Maximum value of a type unsigned| 4294967295            |
    |              | long int (32-bit system).       |                       |
    | ULONGMAX    | Maximum value of a type unsigned| 18446744073709551615  |
    |              | long int (64-bit system).       |                       |
    |______________|_________________________________|_______________________|
    | ULONGLONGMAX| Maximum value of a type unsigned| 18446744073709551615  |
    |              | long int.                       |                       |
    |______________|_________________________________|_______________________|





Page 9                       Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

     _________________________________________________________________________
    |              |                                 | Minimum               |
    | Name         | Description                     | Acceptable Value      |
    |______________|_________________________________|_______________________|
    | USHRTMAX    | Maximum value for a type        | 65535                 |
    |              | unsigned short int.             |                       |
    |______________|_________________________________|_______________________|
    | WORDBIT     | Number of bits in a word or type| 16                    |
    |              | int.                            |                       |
    |______________|_________________________________|_______________________|
    | CHARMIN     | Minimum value of a type char.   | SCHARMIN or 0        |
    |______________|_________________________________|_______________________|
    | INTMIN      | Minimum value of a type int.    | -2147483647           |
    |______________|_________________________________|_______________________|
    | LONGMIN     | Minimum value of a type long int| -2147483647-1         |
    |              | (32-bit system).                |                       |
    | LONGMIN     | Minimum value of a type long int| -9223372036854775807-1|
    |              | (64-bit system).                |                       |
    |______________|_________________________________|_______________________|
    | LONGLONGMIN | Minimum value of a type long    | -9223372036854775807-1|
    |              | int.                            |                       |
    |______________|_________________________________|_______________________|
    | SCHARMIN    | Minimum value of a type signed  | -127                  |
    |              | char.                           |                       |
    |______________|_________________________________|_______________________|
    | SHRTMIN     | Minimum value of a type short.  | -32767                |
    |______________|_________________________________|_______________________|



























Page 10                      Reliant UNIX 5.44                Printed 11/98

limits(4)                                                         limits(4)

   Other Invariant Values

     The following constants are defined on all systems in limits.h.
     ______________________________________________________________________
    |                    |                            |  Minimum          |
    | Name               |  Description               |  Acceptable Value |
    |____________________|____________________________|___________________|
    | CHARCLASSNAMEMAX |  Maximum number of bytes in|  14               |
    |                    |  a character class name.   |                   |
    |____________________|____________________________|___________________|
    | NLARGMAX          |  Maximum value of digit in |  9                |
    |                    |  calls to the print() and  |                   |
    |                    |  scanf() functions.        |                   |
    |____________________|____________________________|___________________|
    | NLLANGMAX         |  Maximum number of bytes in|  14               |
    |                    |  a LANG name.              |                   |
    |____________________|____________________________|___________________|
    | NLMSGMAX          |  Maximum message number.   |  32767            |
    |____________________|____________________________|___________________|
    | NLNMAX            |  Maximum number of bytes in|  not defined      |
    |                    |  an N-to-1 collation map-  |                   |
    |                    |  ping.                     |                   |
    |____________________|____________________________|___________________|
    | NLSETMAX          |  Maximum set number.       |  255              |
    |____________________|____________________________|___________________|
    | NLTEXTMAX         |  Maximum number of bytes in|  POSIX2LINEMAX |
    |                    |  a message string.         |                   |
    |____________________|____________________________|___________________|
    | NZERO              |  Default process priority. |  20               |
    |____________________|____________________________|___________________|
    | TMPMAX            |  Minimum number of unique  |  10000            |
    |                    |  pathnames generated by    |                   |
    |                    |  tmpnam(). Maximum number  |                   |
    |                    |  of times an application   |                   |
    |                    |  can call tmpnam() reli-   |                   |
    |                    |  ably.                     |                   |
    |____________________|____________________________|___________________|

     TMPMAX is moved to stdio.h to align with the ISO C standard.

     DBLDIG, DBLMAX, DBLMIN, FLTDIG, FLTMAX, and FLTMIN are moved to
     float.h.

     DBLMIN and FLTMIN are withdrawn since the values previously defined
     here were in direct conflict with the values in float.h as required by
     the ISO C standard.

SEE ALSO
     fpathconf(2), pathconf(2), sysconf(3C), lfs(5).





Page 11                      Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026