Defines implementation limits identified by IEEE POSIX 1003.
The limits.h file contains definitions required by the ANSI X3.159-198x Programming Language C Standard and the Institute of Electrical and Electronics Engineers (IEEE) P1003.1 Portable Operating System Interface for Computer Environments (POSIX) standard.
The constants required by the ANSI C Standard describe the sizes of basic data types, as follows:
Symbol | Value | Explanation |
CHAR_BIT | 8 | Number of bits in a variable of type char |
CHAR_MAX | 255 | Maximum value of a variable of type char |
CHAR_MIN | 0 | Minimum value of a variable of type char |
INT_MAX | 2,147,483,647 | Maximum value of a variable of type int |
INT_MIN | -2,147,483,648 | Minimum value of a variable of type int |
LONG_MAX | 2,147,483,647 | Maximum value of a variable of type long |
LONG_MIN | -2,147,483,648 | Maximum value of a variable of type long |
SCHAR_MAX | 127 | Maximum value of a variable of type signed char |
SCHAR_MIN | -128 | Minimum value of a variable of type signed char |
SHRT_MAX | 32,767 | Maximum value of a variable of type short |
SHRT_MIN | -32,768 | Maximum value of a variable of type short |
UCHAR_MAX | 255 | Maximum value of a variable of type unsigned char |
UINT_MAX | 4,294,967,295 | Maximum value of a variable of type unsigned int |
ULONG_MAX | 4,294,967,295 | Maximum value of a variable of type unsigned long |
USHRT_MAX | 65,535 | Maximum value of a variable of type unsigned short |
The first set of values required by POSIX, run-time invariant values, are simple constants determined by basic operating system data-structure sizes.
Symbol | Value | Explanation |
MAX_INPUT | 512 | No fewer than the number of bytes specified by the MAX_INPUT symbol are allowed in a terminal input queue. |
NGROUPS_MAX | 32 | Maximum size of the concurrent group list. |
PASS_MAX | 32 | Maximum number of bytes in a password (not including the null terminator).Only eight characters of password information are significant. |
PID_MAX | INT_MAX | Maximum value for a processID. |
UID_MAX | ULONG_MAX | Maximum value for a user or group ID. |
The second set of run-time invariant values required by POSIX specify values that might vary, especially due to system load, but that can be attained on a lightly loaded system.
Symbol | Value | Explanation |
ARG_MAX | 24,576> | Maximum length (in bytes) of arguments for the exec subroutine, including the environment |
Note: The argument list and environment are allowed to consume all of the user data segment.
CHILD_MAX | 40 | Maximum number of simultaneous processes per user ID |
MAX_CANON | 256 | Maximum number of bytes in a canonical input line | OPEN_MAX | 32767 | Maximum number of files that one process can have open at any given time |
The third set of values required by POSIX, path-name variable values, represent constraints imposed by the file system on file path names. Further constraints on these values might be imposed by the underlying file-system implementation. Use the pathconf or fpathconf subroutine to determine any file-implementation characteristics specific to the underlying file system.
Symbol | Value | Explanation |
NAME_MAX | Undefined | Maximum number of bytes in a file component name (not including the null terminator) |
PATH_MAX | 512 | Maximum number of bytes in a path name (not including the null terminator) |
The fourth set of values required by POSIX specify values that might be increased at run time. Use the pathconf or fpathconf subroutine to determine any file-implementation characteristics specific to the underlying file system.
Symbol | Value | Explanation |
LINK_MAX | 32,767 | Maximum value of a file's link count (SHRT_MAX). |
PIPE_BUF | 32,768 | Maximum number of bytes guaranteed to be written automatically to a pipe. |
This file is provided for POSIX compatibility.
This file is part of Base Operating System (BOS) Runtime.
The values.h file.
The exec subroutine, pathconf or fpathconf subroutine.
The Header Files Overview defines header files, describes how they are used, and lists several of the header files for which information is provided in this documentation.