1 #ifndef _LIBC_LIMITS_H_
2 # define _LIBC_LIMITS_H_ 1
6 #include <sys/syslimits.h>
9 # define MB_LEN_MAX _MB_LEN_MAX
14 /* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */
19 /* if do not have #include_next support, then we
20 have to define the limits here. */
21 # if !defined __GNUC__ || __GNUC__ < 2
26 # include <sys/config.h>
28 /* Number of bits in a `char'. */
32 /* Minimum and maximum values a `signed char' can hold. */
34 # define SCHAR_MIN (-128)
36 # define SCHAR_MAX 127
38 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
40 # define UCHAR_MAX 255
42 /* Minimum and maximum values a `char' can hold. */
43 # ifdef __CHAR_UNSIGNED__
50 # define CHAR_MIN (-128)
55 /* Minimum and maximum values a `signed short int' can hold. */
57 /* For the sake of 16 bit hosts, we may not use -32768 */
58 # define SHRT_MIN (-32767-1)
60 # define SHRT_MAX 32767
62 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
64 # define USHRT_MAX 65535
66 /* Minimum and maximum values a `signed int' can hold. */
68 # define __INT_MAX__ 2147483647
71 # define INT_MIN (-INT_MAX-1)
73 # define INT_MAX __INT_MAX__
75 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
77 # define UINT_MAX (INT_MAX * 2U + 1)
79 /* Minimum and maximum values a `signed long int' can hold.
82 # if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
83 # define __LONG_MAX__ 9223372036854775807L
85 # define __LONG_MAX__ 2147483647L
86 # endif /* __alpha__ || sparc64 */
89 # define LONG_MIN (-LONG_MAX-1)
91 # define LONG_MAX __LONG_MAX__
93 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
95 # define ULONG_MAX (LONG_MAX * 2UL + 1)
97 # ifndef __LONG_LONG_MAX__
98 # define __LONG_LONG_MAX__ 9223372036854775807LL
101 # if __ISO_C_VISIBLE >= 1999
102 /* Minimum and maximum values a `signed long long int' can hold. */
104 # define LLONG_MIN (-LLONG_MAX-1)
106 # define LLONG_MAX __LONG_LONG_MAX__
108 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
110 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
114 /* Minimum and maximum values a `signed long long int' can hold. */
115 # undef LONG_LONG_MIN
116 # define LONG_LONG_MIN (-LONG_LONG_MAX-1)
117 # undef LONG_LONG_MAX
118 # define LONG_LONG_MAX __LONG_LONG_MAX__
120 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
121 # undef ULONG_LONG_MAX
122 # define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
125 # endif /* _LIMITS_H */
128 #endif /* !_LIBC_LIMITS_H_ */
130 #if defined __GNUC__ && !defined _GCC_LIMITS_H_
131 /* `_GCC_LIMITS_H_' is what GCC's file defines. */
132 # include_next <limits.h>
133 #endif /* __GNUC__ && !_GCC_LIMITS_H_ */
135 #ifndef _POSIX2_RE_DUP_MAX
136 /* The maximum number of repeated occurrences of a regular expression
137 * permitted when using the interval notation `\{M,N\}'. */
138 #define _POSIX2_RE_DUP_MAX 255
139 #endif /* _POSIX2_RE_DUP_MAX */
146 #define PATH_MAX 4096