3 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
6 This file is part of Cygwin.
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
16 #ifndef _MACH_MACHLIMITS_H_
18 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
20 #define _MACH_MACHLIMITS_H_
23 /* Numerical limits */
25 /* Number of bits in a `char'. */
29 /* Maximum length of a multibyte character. */
31 /* TODO: This is newlib's max value. We should probably rather define our
32 own _mbtowc_r and _wctomb_r functions which are only codepage dependent. */
36 /* Minimum and maximum values a `signed char' can hold. */
38 #define SCHAR_MIN (-128)
42 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
46 /* Minimum and maximum values a `char' can hold. */
47 #ifdef __CHAR_UNSIGNED__
54 #define CHAR_MIN (-128)
59 /* Minimum and maximum values a `signed short int' can hold. */
61 #define SHRT_MIN (-32768)
63 #define SHRT_MAX 32767
65 /* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
67 #define USHRT_MAX 65535
69 /* Minimum and maximum values a `signed int' can hold. */
71 #define __INT_MAX__ 2147483647
74 #define INT_MIN (-INT_MAX-1)
76 #define INT_MAX __INT_MAX__
78 /* Maximum value an `unsigned int' can hold. (Minimum is 0). */
80 #define UINT_MAX (INT_MAX * 2U + 1)
82 /* Minimum and maximum values a `signed long int' can hold.
86 #define __LONG_MAX__ 2147483647L
88 #define __LONG_MAX__ 9223372036854775807L
89 # endif /* __alpha__ */
92 #define LONG_MIN (-LONG_MAX-1)
94 #define LONG_MAX __LONG_MAX__
96 /* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
98 #define ULONG_MAX (LONG_MAX * 2UL + 1)
100 /* Minimum and maximum values a `signed long long int' can hold. */
101 #ifndef __LONG_LONG_MAX__
102 #define __LONG_LONG_MAX__ 9223372036854775807LL
105 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
107 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
109 #define LONG_LONG_MAX __LONG_LONG_MAX__
111 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
112 #undef ULONG_LONG_MAX
113 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
116 /* Minimum and maximum values a `signed long long int' can hold. */
118 #define LLONG_MIN (-LLONG_MAX-1)
120 #define LLONG_MAX __LONG_LONG_MAX__
122 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
124 #define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
126 /* Maximum size of ssize_t */
128 #define SSIZE_MAX (__LONG_MAX__)
131 /* Runtime Invariant Values */
133 /* Please note that symbolic names shall be ommited, on specific
134 implementations where the corresponding value is equal to or greater
135 than the stated minimum, but is unspecified. This indetermination
136 might depend on the amount of available memory space on a specific
137 instance of a specific implementation. The actual value supported by
138 a specific instance shall be provided by the sysconf() function. */
140 /* Maximum number of I/O operations in a single list I/O call supported by
141 the implementation. Not yet implemented. */
142 #undef AIO_LISTIO_MAX
143 /* #define AIO_LISTIO_MAX >= _POSIX_AIO_LISTIO_MAX */
145 /* Maximum number of outstanding asynchronous I/O operations supported by
146 the implementation. Not yet implemented. */
148 /* #define AIO_MAX >= _POSIX_AIO_MAX */
150 /* The maximum amount by which a process can decrease its asynchronous I/O
151 priority level from its own scheduling priority. */
152 #undef AIO_PRIO_DELTA_MAX
153 /* #define AIO_PRIO_DELTA_MAX >= 0 */
155 /* Maximum number of bytes in arguments and environment passed in an exec
156 call. 32000 is the safe value used for Windows processes when called
157 from Cygwin processes. */
159 #define ARG_MAX 32000
161 /* Maximum number of functions that may be registered with atexit(). */
163 #define ATEXIT_MAX 32
165 /* Maximum number of simultaneous processes per real user ID. */
167 #define CHILD_MAX 256
169 /* Maximum number of timer expiration overruns. Not yet implemented. */
170 #undef DELAYTIMER_MAX
171 /* #define DELAYTIMER_MAX >= _POSIX_DELAYTIMER_MAX */
173 /* Maximum length of a host name. */
175 #define HOST_NAME_MAX 255
177 /* Maximum number of iovcnt in a writev (an arbitrary number) */
181 /* Maximum number of characters in a login name. */
182 #undef LOGIN_NAME_MAX
183 #define LOGIN_NAME_MAX 256 /* equal to UNLEN defined in w32api/lmcons.h */
185 /* The maximum number of open message queue descriptors a process may hold. */
187 #define MQ_OPEN_MAX OPEN_MAX
189 /* The maximum number of message priorities supported by the implementation. */
191 #define MQ_PRIO_MAX INT_MAX
193 /* # of open files per process. Actually it can be more since Cygwin
194 grows the dtable as necessary. We define a reasonable limit here
195 which is returned by getdtablesize(), sysconf(_SC_OPEN_MAX) and
196 getrlimit(RLIMIT_NOFILE). */
200 /* Size in bytes of a page. */
203 #define PAGESIZE 65536
204 #define PAGE_SIZE PAGESIZE
206 /* Maximum number of attempts made to destroy a thread's thread-specific
207 data values on thread exit. */
208 /* FIXME: I really don't understand this value. Why should multiple
209 attempts be necessary to destroy thread-specific data?!? Anyway, the
210 current value here is 1, taken originally from our pthread.h file,
211 where it was mistakenly defined first. Unfortunately this value is
212 lower than the POSIX defined minimum value, which is 4. */
213 #undef PTHREAD_DESTRUCTOR_ITERATIONS
214 #define PTHREAD_DESTRUCTOR_ITERATIONS 1
216 /* Maximum number of data keys that can be created by a process. */
217 /* Tls has 64 items for pre win2000 - and we don't want to use them all :] */
218 #undef PTHREAD_KEYS_MAX
219 #define PTHREAD_KEYS_MAX 32
221 /* Minimum size in bytes of thread stack storage. */
222 /* Actually the minimum stack size is somewhat of a split personality.
223 The size parameter in a CreateThread call is the size of the initially
224 commited stack size, which can be specified as low as 4K. However, the
225 default *reserved* stack size is 1 Meg, unless the .def file specifies
226 another STACKSIZE value. And even if you specify a stack size below 64K,
227 the allocation granularity is in the way. You can never squeeze multiple
228 threads in the same allocation granularity slot. Oh well. */
229 #undef PTHREAD_STACK_MIN
230 #define PTHREAD_STACK_MIN 65536
232 /* Maximum number of threads that can be created per process. */
233 /* Windows allows any arbitrary number of threads per process. */
234 #undef PTHREAD_THREADS_MAX
235 /* #define PTHREAD_THREADS_MAX unspecified */
237 /* Maximum number of realtime signals reserved for application use. */
238 /* FIXME: We only support one realtime signal but _POSIX_RTSIG_MAX is 8. */
242 /* Maximum number of semaphores that a process may have. */
243 /* Windows allows any arbitrary number of semaphores per process. */
245 /* #define SEM_NSEMS_MAX unspecified */
247 /* The maximum value a semaphore may have. */
249 #define SEM_VALUE_MAX 1147483648
251 /* Maximum number of queued signals that a process may send and have pending
252 at the receiver(s) at any time. */
254 #define SIGQUEUE_MAX 32
256 /* The maximum number of replenishment operations that may be simultaneously
257 pending for a particular sporadic server scheduler. Not implemented. */
259 /* #define SS_REPL_MAX >= _POSIX_SS_REPL_MAX */
261 /* Number of streams that one process can have open at one time. */
263 #define STREAM_MAX 20
265 /* Maximum number of nested symbolic links. */
267 #define SYMLOOP_MAX 10
269 /* Maximum number of timer expiration overruns. */
273 /* Maximum length of the trace event name. Not implemented. */
274 #undef TRACE_EVENT_NAME_MAX
275 /* #define TRACE_EVENT_NAME_MAX >= _POSIX_TRACE_EVENT_NAME_MAX */
277 /* Maximum length of the trace generation version string or of the trace
278 stream name. Not implemented. */
279 #undef TRACE_NAME_MAX
280 /* #define TRACE_NAME_MAX >= _POSIX_TRACE_NAME_MAX */
282 /* Maximum number of trace streams that may simultaneously exist in the
283 system. Not implemented. */
285 /* #define TRACE_SYS_MAX >= _POSIX_TRACE_SYS_MAX */
287 /* Maximum number of user trace event type identifiers that may simultaneously
288 exist in a traced process, including the predefined user trace event
289 POSIX_TRACE_UNNAMED_USER_EVENT. Not implemented. */
290 #undef TRACE_USER_EVENT_MAX
291 /* #define TRACE_USER_EVENT_MAX >= _POSIX_TRACE_USER_EVENT_MAX */
293 /* Maximum number of characters in a tty name. */
295 #define TTY_NAME_MAX 32
297 /* Maximum number of bytes supported for the name of a timezone (not of the TZ variable). Not implemented. */
299 /* #define TZNAME_MAX >= _POSIX_TZNAME_MAX */
302 /* Pathname Variable Values */
304 /* Minimum bits needed to represent the maximum size of a regular file. */
306 #define FILESIZEBITS 64
308 /* Maximum number of hardlinks to a file. */
310 #define LINK_MAX 1024
312 /* Maximum number of bytes in a terminal canonical input line. */
314 #define MAX_CANON 255
316 /* Minimum number of bytes available in a terminal input queue. */
318 #define MAX_INPUT 255
320 /* Maximum length of a path component. */
324 /* Maximum length of a path given to API functions including trailing NUL.
325 Deliberately set to the same default value as on Linux. Internal paths
327 /* Keep in sync with __PATHNAME_MAX__ in cygwin/config.h */
329 #define PATH_MAX 4096
331 /* # of bytes in a pipe buf. This is the max # of bytes which can be
332 written to a pipe in one atomic operation. */
334 #define PIPE_BUF 4096
336 /* Minimum number of bytes of storage actually allocated for any portion
337 of a file. Not implemented. */
338 #undef POSIX_ALLOC_SIZE_MIN
339 /* #define POSIX_ALLOC_SIZE_MIN unspecifed */
341 /* Recommended increment for file transfer sizes between the
342 {POSIX_REC_MIN_XFER_SIZE} and {POSIX_REC_MAX_XFER_SIZE} values.
344 #undef POSIX_REC_INCR_XFER_SIZE
345 /* #define POSIX_REC_INCR_XFER_SIZE unspecifed */
347 /* Maximum recommended file transfer size. Not implemented. */
348 #undef POSIX_REC_MAX_XFER_SIZE
349 /* #define POSIX_REC_MAX_XFER_SIZE unspecifed */
351 /* Minimum recommended file transfer size. Not implemented. */
352 #undef POSIX_REC_MIN_XFER_SIZE
353 /* #define POSIX_REC_MIN_XFER_SIZE unspecifed */
355 /* Recommended file transfer buffer alignment. Not implemented. */
356 #undef POSIX_REC_XFER_ALIGN
357 /* #define POSIX_REC_XFER_ALIGN unspecifed */
359 /* Maximum number of bytes in a symbolic link. */
361 #define SYMLINK_MAX (PATH_MAX - 1)
364 /* Runtime Increasable Values */
366 /* Maximum obase values allowed by the bc utility. */
368 #define BC_BASE_MAX 99
370 /* Maximum number of elements permitted in an array by the bc utility. */
372 #define BC_DIM_MAX 2048
374 /* Maximum scale value allowed by the bc utility. */
376 #define BC_SCALE_MAX 99
378 /* Maximum length of a string constant accepted by the bc utility. */
380 #define BC_STRING_MAX 1000
382 /* Maximum number of bytes in a character class name. Not implemented. */
383 #undef CHARCLASS_NAME_MAX
384 /* #define CHARCLASS_NAME_MAX >= _POSIX2_CHARCLASS_NAME_MAX */
386 /* Maximum number of weights that can be assigned to an entry of the
387 LC_COLLATE order keyword in the locale definition file. */
388 /* FIXME: We don't support this at all right now, so this value is
389 misleading at best. It's also lower than _POSIX2_COLL_WEIGHTS_MAX
390 which is not good. So, for now we deliberately not define it even
391 though it was defined in the former syslimits.h file. */
392 #undef COLL_WEIGHTS_MAX
393 /* #define COLL_WEIGHTS_MAX >= _POSIX2_COLL_WEIGHTS_MAX */
395 /* Maximum number of expressions that can be nested within parentheses
396 by the expr utility. */
398 #define EXPR_NEST_MAX 32
400 /* Maximum bytes of a text utility's input line */
402 #define LINE_MAX 2048
404 /* Max num groups for a user, value taken from NT documentation */
405 /* Must match <sys/param.h> NGROUPS */
407 #define NGROUPS_MAX 1024
409 /* Maximum number of repeated occurrences of a regular expression when
410 using the interval notation \{m,n\} */
412 #define RE_DUP_MAX 255
416 /* These should never vary from one system type to another */
417 /* They represent the minimum values that POSIX systems must support.
418 POSIX-conforming apps must not require larger values. */
422 #define _POSIX_CLOCKRES_MIN 20000000
426 #define _POSIX_AIO_LISTIO_MAX 2
427 #define _POSIX_AIO_MAX 1
428 #define _POSIX_ARG_MAX 4096
429 #define _POSIX_CHILD_MAX 25
430 #define _POSIX_DELAYTIMER_MAX 32
431 #define _POSIX_HOST_NAME_MAX 255
432 #define _POSIX_LINK_MAX 8
433 #define _POSIX_LOGIN_NAME_MAX 9
434 #define _POSIX_MAX_CANON 255
435 #define _POSIX_MAX_INPUT 255
436 #define _POSIX_MQ_OPEN_MAX 8
437 #define _POSIX_MQ_PRIO_MAX 32
438 #define _POSIX_NAME_MAX 14
439 #define _POSIX_NGROUPS_MAX 8
440 #define _POSIX_OPEN_MAX 20
441 #define _POSIX_PATH_MAX 256
442 #define _POSIX_PIPE_BUF 512
443 #define _POSIX_RE_DUP_MAX 255
444 #define _POSIX_RTSIG_MAX 8
445 #define _POSIX_SEM_NSEMS_MAX 256
446 #define _POSIX_SEM_VALUE_MAX 32767
447 #define _POSIX_SIGQUEUE_MAX 32
448 #define _POSIX_SSIZE_MAX 32767
449 #define _POSIX_STREAM_MAX 8
450 #define _POSIX_SS_REPL_MAX 4
451 #define _POSIX_SYMLINK_MAX 255
452 #define _POSIX_SYMLOOP_MAX 8
453 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
454 #define _POSIX_THREAD_KEYS_MAX 128
455 #define _POSIX_THREAD_THREADS_MAX 64
456 #define _POSIX_TIMER_MAX 32
457 #define _POSIX_TRACE_EVENT_NAME_MAX 30
458 #define _POSIX_TRACE_NAME_MAX 8
459 #define _POSIX_TRACE_SYS_MAX 8
460 #define _POSIX_TRACE_USER_EVENT_MAX 32
461 #define _POSIX_TTY_NAME_MAX 9
462 #define _POSIX_TZNAME_MAX 6
464 #define _POSIX2_BC_BASE_MAX 99
465 #define _POSIX2_BC_DIM_MAX 2048
466 #define _POSIX2_BC_SCALE_MAX 99
467 #define _POSIX2_BC_STRING_MAX 1000
468 #define _POSIX2_COLL_WEIGHTS_MAX 2
469 #define _POSIX2_EXPR_NEST_MAX 32
470 #define _POSIX2_LINE_MAX 2048
471 #define _POSIX2_RE_DUP_MAX 255
473 #define _XOPEN_IOV_MAX 16
474 #define _XOPEN_NAME_MAX 255
475 #define _XOPEN_PATH_MAX 1024
477 /* Other Invariant Values */
480 #define NL_LANGMAX 14
481 #define NL_MSGMAX 32767
482 #define NL_NMAX INT_MAX
483 #define NL_SETMAX 255
484 #define NL_TEXTMAX _POSIX2_LINE_MAX
486 /* Default process priority. */
490 #endif /* _MACH_MACHLIMITS_H_ */
491 #endif /* _LIMITS_H___ */