2 * Copyright © 2004 The AROS Developmemt Team. All rights reserved.
5 * ISO C99 Standard: Sizes of integer types <limits.h>
6 * POSIX Standard: implementation-defined constants
12 #include <sys/cdefs.h>
15 * Define ANSI <limits.h> for standard 32-bit words.
18 * 16-bit 'short int', and
19 * 32-bit 'int' and 'long int'.
22 /* Number of bits in a 'char' */
25 /* Minimum and maximum number displayable with 'signed char' */
26 #define SCHAR_MIN (-128)
29 /* Minimum and maximum number displayable with 'char' */
30 #define CHAR_MIN SCHAR_MIN
31 #define CHAR_MAX SCHAR_MAX
33 /* Maximum number displayable with 'unsigned char'. Minimum is 0. */
37 /* Minimum and maximum number displayable with 'signed short int' */
38 #define SHRT_MIN (-32768)
39 #define SHRT_MAX 32767
41 /* Maximum number displayable with 'unsigned short int'. Minimum is 0. */
42 #define USHRT_MAX 65535
45 /* Minimum and maximum displayable with 'signed int' */
46 #define INT_MAX 2147483647
47 #define INT_MIN (-INT_MAX - 1)
49 /* Maximum value displayable with 'unsigned int'. Minimum is 0. */
50 # define UINT_MAX 4294967295U
52 /* Minimum and maximum number displayable with `signed long int' */
54 # define LONG_MAX 9223372036854775807L
56 # define LONG_MAX 2147483647L
58 #define LONG_MIN (-LONG_MAX - 1L)
60 /* Maximum number displayable with `unsigned long int'. Minimum is 0. */
62 # define ULONG_MAX 18446744073709551615UL
64 # define ULONG_MAX 4294967295UL
67 #define LLONG_MIN (-0x7fffffffffffffffLL - 1)
68 #define LLONG_MAX 0x7fffffffffffffffLL
69 #define ULLONG_MAX 0xffffffffffffffffULL
71 #define MB_LEN_MAX 6 /* 31-bit UTF-8 */
74 * The POSIX limits are quite complex. You can actually omit half these
75 * definitions if you can't determine them at compile time. You are
76 * supposed to use sysconf() to query the actual values.
78 * There are also made visible by POSIX version. Please don't change
79 * that, otherwise we are no longer POSIX compatible.
83 #define ARG_MAX _POSIX_ARG_MAX
84 #define CHILD_MAX _POSIX_CHILD_MAX
85 #define LINK_MAX _POSIX_LINK_MAX
86 #define MAX_CANON _POSIX_MAX_CANON
87 #define MAX_INPUT _POSIX_MAX_INPUT
88 #define OPEN_MAX _POSIX_OPEN_MAX
89 #define PIPE_BUF _POSIX_PIPE_BUF
90 #define STREAM_MAX _POSIX_STREAM_MAX
91 #define TZNAME_MAX _POSIX_TZNAME_MAX
93 #define BC_BASE_MAX _POSIX2_BC_BASE_MAX
94 #define BC_DIM_MAX _POSIX2_BC_DIM_MAX
95 #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
96 #define BC_STRING_MAX _POSIX2_BC_STRING_MAX
97 #define CHARCLASS_NAME_MAX _POSIX2_CHARCLASS_NAME_MAX
98 #define COLL_WEIGHTS_MAX _POSIX2_COLL_WEIGHTS_MAX
99 #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
100 #define LINE_MAX _POSIX2_LINE_MAX
101 #define RE_DUP_MAX _POSIX2_RE_DUP_MAX
103 #define _POSIX_ARG_MAX 4096
104 #define _POSIX_CHILD_MAX 25
105 #define _POSIX_LINK_MAX 8
106 #define _POSIX_MAX_CANON 255
107 #define _POSIX_MAX_INPUT 255
108 #define _POSIX_OPEN_MAX 20
109 #define _POSIX_NAME_MAX 32
110 #define _POSIX_NGROUPS_MAX 16
111 #define _POSIX_PATH_MAX 256
112 #define _POSIX_PIPE_BUF 512
113 #define _POSIX_SSIZE_MAX 32767
114 #define _POSIX_STREAM_MAX 8
115 #define _POSIX_TZNAME_MAX 6
116 #define _POSIX2_BC_BASE_MAX 99
117 #define _POSIX2_BC_DIM_MAX 2048
118 #define _POSIX2_BC_SCALE_MAX 99
119 #define _POSIX2_BC_STRING_MAX 1000
120 #define _POSIX2_EQUIV_CLASS_MAX 2
121 #define _POSIX2_EXPR_NEST_MAX 32
122 #define _POSIX2_LINE_MAX 2048
123 #define _POSIX2_RE_DUP_MAX 255
126 #if __POSIX_VISIBLE >= 199506
127 #define _POSIX_AIO_LISTIO_MAX 2
128 #define _POSIX_AIO_MAX 1
129 #define _POSIX_DELAYTIMER_MAX 32
130 #define _POSIX_MQ_OPEN_MAX 8
131 #define _POSIX_MQ_PRIO_MAX 32
132 #define _POSIX_RTSIG_MAX 8
133 #define _POSIX_SEM_NSEMS_MAX 255
134 #define _POSIX_SEM_MAX_VALUE 32767
135 #define _POSIX_SIGQUEUE_MAX 32
136 #define _POSIX_TIMER_MAX 32
139 #if __POSIX_VISIBLE >= 199506
140 #define _POSIX_THREAD_DESTRUCTOR_INTERATIONS 4
141 #define _POSIX_THREAD_KEYS_MAX 128
142 #define _POSIX_THREAD_THREADS_MAX 64
145 #if __POSIX_VISIBLE >= 200112
146 #define FILESIZEBITS 32
147 #define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
148 #define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
149 #define SYMLINK_MAX _POSIX_SYMLINK_MAX
150 #define SYMLOOP_MAX _POSIX_SYMLOOP_MAX
151 #define TTY_NAME_MAX _POSIX_TTY_NAME_MAX
152 #define NGROUPS_MAX _POSIX_NGROUPS_MAX
154 #define _POSIX_HOST_NAME_MAX 255
155 #define _POSIX_LOGIN_NAME_MAX 9
156 #define _POSIX_SS_REPL_MAX 4
157 #define _POSIX_SYMLINK_MAX 255
158 #define _POSIX_SYMLOOP_MAX 8
159 #define _POSIX_RE_DUP_MAX 255
160 #define _POSIX_TRACE_EVENT_NAME_MAX 30
161 #define _POSIX_TRACE_NAME_MAX 8
162 #define _POSIX_TRACE_SYS_MAX 8
163 #define _POSIX_TRACE_USER_EVENT_MAX 32
164 #define _POSIX_TTY_NAME_MAX 9
165 #define _POSIX2_CHARCLASS_NAME_MAX 14
166 #define _POSIX2_COLL_WEIGHTS_MAX 2
170 #define ATEXIT_MAX 32
171 #define IOV_MAX _XOPEN_IOV_MAX
172 #define PAGESIZE 4096
173 #define PAGE_SIZE PAGESIZE
174 #define NAME_MAX _XOPEN_NAME_MAX
175 #define PATH_MAX _XOPEN_PATH_MAX
177 #define _XOPEN_IOV_MAX 16
178 #define _XOPEN_NAME_MAX 255
179 #define _XOPEN_PATH_MAX 1024
182 #define NL_LANGMAX 14
183 #define NL_MSGMAX 32767
185 #define NL_SETMAX 255
186 #define NL_TEXTMAX _POSIX2_LINE_MAX
192 * The following are specific to particular POSIX subsystems, which are
193 * switched on or off as part of <unistd.h>
196 #if __POSIX_VERSION >= 200112
197 /* _POSIX_ADVISORY_INFO */
198 #define POSIX_ALLOC_SIZE_MIN // XXX
199 #define POSIX_REC_INCR_XFER_SIZE // XXX
200 #define POSIX_REC_MAX_XFER_SIZE // XXX
201 #define POSIX_REC_XFER_ALIGN // XXX
203 /* _POSIX_ASYNCHRONOUS_IO */
204 #define AIO_LISTIO_MAX _POSIX_AIO_LISTIO_MAX
205 #define AIO_MAX _POSIX_AIO_MAX
206 #define AIO_PRIO_DELTA_MAX 0
208 /* _POSIX_MESSAGE_PASSING */
209 #define MQ_OPEN_MAX _POSIX_MQ_OPEN_MAX
210 #define MQ_PRIO_MAX _POSIX_MQ_PRIO_MAX
212 /* _POSIX_REALTIME_SIGNALS */
213 #define RTSIG_MAX _POSIX_RTSIG_MAX
214 #define SIGQUEUE_MAX _POSIX_SIGQUEUE_MAX
216 /* _POSIX_SEMAPHORES */
217 #define SEM_NSEMS_MAX _POSIX_SEM_NSEMS_MAX
218 #define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX
220 /* _POSIX_SPORADIC_SERVER */
221 #define SS_REPL_MAX _POSIX_SS_REPL_MAX
224 #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
225 #define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
226 #define PTHREAD_STACK_MIN 0
227 #define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
230 #define DELAYTIMER_MAX _POSIX_DELAYTIMER_MAX
231 #define TIMER_MAX _POSIX_TIMER_MAX
234 #define TRACE_EVENT_NAME_MAX _POSIX_TRACE_EVENT_NAME_MAX
235 #define TRACE_NAME_MAX _POSIX_TRACE_NAME_MAX
236 #define TRACE_SYS_MAX _POSIX_TRACE_SYS_MAX
237 #define TRACE_USER_EVENT_MAX _POSIX_TRACE_USER_EVENT_MAX
240 #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
241 #define SIZE_T_MAX ULONG_MAX /* max value for a size_t */
244 #endif /* _LIMITS_H_ */