3 Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
15 #ifndef _MACH_MACHLIMITS_H_
17 /* _MACH_MACHLIMITS_H_ is used on OSF/1. */
19 #define _MACH_MACHLIMITS_H_
22 /* Numerical limits */
24 /* Number of bits in a `char'. */
28 /* Maximum length of a multibyte character. */
33 /* Minimum and maximum values a `signed char' can hold. */
35 #define SCHAR_MIN (-128)
39 /* Maximum value an `unsigned char' can hold. (Minimum is 0). */
43 /* Minimum and maximum values a `char' can hold. */
44 #ifdef __CHAR_UNSIGNED__
51 #define CHAR_MIN (-128)
56 /* Minimum and maximum values a `signed short int' can hold. */
58 #define SHRT_MIN (-32768)
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.
83 #define __LONG_MAX__ 2147483647L
85 #define __LONG_MAX__ 9223372036854775807L
86 # endif /* __alpha__ */
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 /* Minimum and maximum values a `signed long long int' can hold. */
98 #ifndef __LONG_LONG_MAX__
99 #define __LONG_LONG_MAX__ 9223372036854775807LL
102 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
104 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
106 #define LONG_LONG_MAX __LONG_LONG_MAX__
108 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
109 #undef ULONG_LONG_MAX
110 #define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
113 /* Minimum and maximum values a `signed long long int' can hold. */
115 #define LLONG_MIN (-LLONG_MAX-1)
117 #define LLONG_MAX __LONG_LONG_MAX__
119 /* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
121 #define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
123 /* Maximum size of ssize_t */
125 #define SSIZE_MAX (__LONG_MAX__)
128 /* Runtime Invariant Values */
130 /* Please note that symbolic names shall be ommited, on specific
131 implementations where the corresponding value is equal to or greater
132 than the stated minimum, but is unspecified. This indetermination
133 might depend on the amount of available memory space on a specific
134 instance of a specific implementation. The actual value supported by
135 a specific instance shall be provided by the sysconf() function. */
137 /* Maximum number of I/O operations in a single list I/O call supported by
138 the implementation. Not yet implemented. */
139 #undef AIO_LISTIO_MAX
140 /* #define AIO_LISTIO_MAX >= _POSIX_AIO_LISTIO_MAX */
142 /* Maximum number of outstanding asynchronous I/O operations supported by
143 the implementation. Not yet implemented. */
145 /* #define AIO_MAX >= _POSIX_AIO_MAX */
147 /* The maximum amount by which a process can decrease its asynchronous I/O
148 priority level from its own scheduling priority. */
149 #undef AIO_PRIO_DELTA_MAX
150 /* #define AIO_PRIO_DELTA_MAX >= 0 */
152 /* Maximum number of bytes in arguments and environment passed in an exec
153 call. 32000 is the safe value used for Windows processes when called
154 from Cygwin processes. */
156 #define ARG_MAX 32000
158 /* Maximum number of functions that may be registered with atexit(). */
160 #define ATEXIT_MAX 32
162 /* Maximum number of simultaneous processes per real user ID. */
164 #define CHILD_MAX 256
166 /* Maximum number of timer expiration overruns. Not yet implemented. */
167 #undef DELAYTIMER_MAX
168 /* #define DELAYTIMER_MAX >= _POSIX_DELAYTIMER_MAX */
170 /* Maximum length of a host name. */
172 #define HOST_NAME_MAX 255
174 /* Maximum number of iovcnt in a writev (an arbitrary number) */
178 /* Maximum number of characters in a login name. */
179 #undef LOGIN_NAME_MAX
180 #define LOGIN_NAME_MAX 256 /* equal to UNLEN defined in w32api/lmcons.h */
182 /* The maximum number of open message queue descriptors a process may hold. */
184 #define MQ_OPEN_MAX OPEN_MAX
186 /* The maximum number of message priorities supported by the implementation. */
188 #define MQ_PRIO_MAX INT_MAX
190 /* # of open files per process. Actually it can be more since Cygwin
191 grows the dtable as necessary. We define a reasonable limit here
192 which is returned by getdtablesize(), sysconf(_SC_OPEN_MAX) and
193 getrlimit(RLIMIT_NOFILE). */
197 /* Size in bytes of a page. */
200 #define PAGESIZE 65536
201 #define PAGE_SIZE PAGESIZE
203 /* Maximum number of attempts made to destroy a thread's thread-specific
204 data values on thread exit. */
205 /* FIXME: I really don't understand this value. Why should multiple
206 attempts be necessary to destroy thread-specific data?!? Anyway, the
207 current value here is 1, taken originally from our pthread.h file,
208 where it was mistakenly defined first. Unfortunately this value is
209 lower than the POSIX defined minimum value, which is 4. */
210 #undef PTHREAD_DESTRUCTOR_ITERATIONS
211 #define PTHREAD_DESTRUCTOR_ITERATIONS 1
213 /* Maximum number of data keys that can be created by a process. */
214 /* Tls has 64 items for pre win2000 - and we don't want to use them all :] */
215 #undef PTHREAD_KEYS_MAX
216 #define PTHREAD_KEYS_MAX 32
218 /* Minimum size in bytes of thread stack storage. */
219 /* Actually the minimum stack size is somewhat of a split personality.
220 The size parameter in a CreateThread call is the size of the initially
221 commited stack size, which can be specified as low as 4K. However, the
222 default *reserved* stack size is 1 Meg, unless the .def file specifies
223 another STACKSIZE value. And even if you specify a stack size below 64K,
224 the allocation granularity is in the way. You can never squeeze multiple
225 threads in the same allocation granularity slot. Oh well. */
226 #undef PTHREAD_STACK_MIN
227 #define PTHREAD_STACK_MIN 65536
229 /* Maximum number of threads that can be created per process. */
230 /* Windows allows any arbitrary number of threads per process. */
231 #undef PTHREAD_THREADS_MAX
232 /* #define PTHREAD_THREADS_MAX unspecified */
234 /* Maximum number of realtime signals reserved for application use. */
235 /* FIXME: We only support one realtime signal but _POSIX_RTSIG_MAX is 8. */
239 /* Maximum number of semaphores that a process may have. */
240 /* Windows allows any arbitrary number of semaphores per process. */
242 /* #define SEM_NSEMS_MAX unspecified */
244 /* The maximum value a semaphore may have. */
246 #define SEM_VALUE_MAX 1147483648
248 /* Maximum number of queued signals that a process may send and have pending
249 at the receiver(s) at any time. */
251 #define SIGQUEUE_MAX 32
253 /* The maximum number of replenishment operations that may be simultaneously
254 pending for a particular sporadic server scheduler. Not implemented. */
256 /* #define SS_REPL_MAX >= _POSIX_SS_REPL_MAX */
258 /* Number of streams that one process can have open at one time. */
260 #define STREAM_MAX 20
262 /* Maximum number of nested symbolic links. */
264 #define SYMLOOP_MAX 10
266 /* Maximum number of timer expiration overruns. */
270 /* Maximum length of the trace event name. Not implemented. */
271 #undef TRACE_EVENT_NAME_MAX
272 /* #define TRACE_EVENT_NAME_MAX >= _POSIX_TRACE_EVENT_NAME_MAX */
274 /* Maximum length of the trace generation version string or of the trace
275 stream name. Not implemented. */
276 #undef TRACE_NAME_MAX
277 /* #define TRACE_NAME_MAX >= _POSIX_TRACE_NAME_MAX */
279 /* Maximum number of trace streams that may simultaneously exist in the
280 system. Not implemented. */
282 /* #define TRACE_SYS_MAX >= _POSIX_TRACE_SYS_MAX */
284 /* Maximum number of user trace event type identifiers that may simultaneously
285 exist in a traced process, including the predefined user trace event
286 POSIX_TRACE_UNNAMED_USER_EVENT. Not implemented. */
287 #undef TRACE_USER_EVENT_MAX
288 /* #define TRACE_USER_EVENT_MAX >= _POSIX_TRACE_USER_EVENT_MAX */
290 /* Maximum number of characters in a tty name. */
292 #define TTY_NAME_MAX 12
294 /* Maximum number of bytes supported for the name of a timezone (not of the TZ variable). Not implemented. */
296 /* #define TZNAME_MAX >= _POSIX_TZNAME_MAX */
299 /* Pathname Variable Values */
301 /* Minimum bits needed to represent the maximum size of a regular file. */
303 #define FILESIZEBITS 64
305 /* Maximum number of hardlinks to a file. */
307 #define LINK_MAX 1024
309 /* Maximum number of bytes in a terminal canonical input line. */
311 #define MAX_CANON 255
313 /* Minimum number of bytes available in a terminal input queue. */
315 #define MAX_INPUT 255
317 /* Maximum length of a path component. */
321 /* Maximum length of a path */
325 /* # of bytes in a pipe buf. This is the max # of bytes which can be
326 written to a pipe in one atomic operation. */
328 #define PIPE_BUF 4096
330 /* Minimum number of bytes of storage actually allocated for any portion
331 of a file. Not implemented. */
332 #undef POSIX_ALLOC_SIZE_MIN
333 /* #define POSIX_ALLOC_SIZE_MIN unspecifed */
335 /* Recommended increment for file transfer sizes between the
336 {POSIX_REC_MIN_XFER_SIZE} and {POSIX_REC_MAX_XFER_SIZE} values.
338 #undef POSIX_REC_INCR_XFER_SIZE
339 /* #define POSIX_REC_INCR_XFER_SIZE unspecifed */
341 /* Maximum recommended file transfer size. Not implemented. */
342 #undef POSIX_REC_MAX_XFER_SIZE
343 /* #define POSIX_REC_MAX_XFER_SIZE unspecifed */
345 /* Minimum recommended file transfer size. Not implemented. */
346 #undef POSIX_REC_MIN_XFER_SIZE
347 /* #define POSIX_REC_MIN_XFER_SIZE unspecifed */
349 /* Recommended file transfer buffer alignment. Not implemented. */
350 #undef POSIX_REC_XFER_ALIGN
351 /* #define POSIX_REC_XFER_ALIGN unspecifed */
353 /* Maximum number of bytes in a symbolic link. */
355 #define SYMLINK_MAX PATH_MAX
358 /* Runtime Increasable Values */
360 /* Maximum obase values allowed by the bc utility. */
362 #define BC_BASE_MAX 99
364 /* Maximum number of elements permitted in an array by the bc utility. */
366 #define BC_DIM_MAX 2048
368 /* Maximum scale value allowed by the bc utility. */
370 #define BC_SCALE_MAX 99
372 /* Maximum length of a string constant accepted by the bc utility. */
374 #define BC_STRING_MAX 1000
376 /* Maximum number of bytes in a character class name. Not implemented. */
377 #undef CHARCLASS_NAME_MAX
378 /* #define CHARCLASS_NAME_MAX >= _POSIX2_CHARCLASS_NAME_MAX */
380 /* Maximum number of weights that can be assigned to an entry of the
381 LC_COLLATE order keyword in the locale definition file. */
382 /* FIXME: We don't support this at all right now, so this value is
383 misleading at best. It's also lower than _POSIX2_COLL_WEIGHTS_MAX
384 which is not good. So, for now we deliberately not define it even
385 though it was defined in the former syslimits.h file. */
386 #undef COLL_WEIGHTS_MAX
387 /* #define COLL_WEIGHTS_MAX >= _POSIX2_COLL_WEIGHTS_MAX */
389 /* Maximum number of expressions that can be nested within parentheses
390 by the expr utility. */
392 #define EXPR_NEST_MAX 32
394 /* Maximum bytes of a text utility's input line */
396 #define LINE_MAX 2048
398 /* Max num groups for a user, value taken from NT documentation */
399 /* Must match <sys/param.h> NGROUPS */
401 #define NGROUPS_MAX 16
403 /* Maximum number of repeated occurrences of a regular expression when
404 using the interval notation \{m,n\} */
406 #define RE_DUP_MAX 255
410 /* These should never vary from one system type to another */
411 /* They represent the minimum values that POSIX systems must support.
412 POSIX-conforming apps must not require larger values. */
416 #define _POSIX_CLOCKRES_MIN 20000000
420 #define _POSIX_AIO_LISTIO_MAX 2
421 #define _POSIX_AIO_MAX 1
422 #define _POSIX_ARG_MAX 4096
423 #define _POSIX_CHILD_MAX 25
424 #define _POSIX_DELAYTIMER_MAX 32
425 #define _POSIX_HOST_NAME_MAX 255
426 #define _POSIX_LINK_MAX 8
427 #define _POSIX_LOGIN_NAME_MAX 9
428 #define _POSIX_MAX_CANON 255
429 #define _POSIX_MAX_INPUT 255
430 #define _POSIX_MQ_OPEN_MAX 8
431 #define _POSIX_MQ_PRIO_MAX 32
432 #define _POSIX_NAME_MAX 14
433 #define _POSIX_NGROUPS_MAX 8
434 #define _POSIX_OPEN_MAX 20
435 #define _POSIX_PATH_MAX 256
436 #define _POSIX_PIPE_BUF 512
437 #define _POSIX_RE_DUP_MAX 255
438 #define _POSIX_RTSIG_MAX 8
439 #define _POSIX_SEM_NSEMS_MAX 256
440 #define _POSIX_SEM_VALUE_MAX 32767
441 #define _POSIX_SIGQUEUE_MAX 32
442 #define _POSIX_SSIZE_MAX 32767
443 #define _POSIX_STREAM_MAX 8
444 #define _POSIX_SS_REPL_MAX 4
445 #define _POSIX_SYMLINK_MAX 255
446 #define _POSIX_SYMLOOP_MAX 8
447 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
448 #define _POSIX_THREAD_KEYS_MAX 128
449 #define _POSIX_THREAD_THREADS_MAX 64
450 #define _POSIX_TIMER_MAX 32
451 #define _POSIX_TRACE_EVENT_NAME_MAX 30
452 #define _POSIX_TRACE_NAME_MAX 8
453 #define _POSIX_TRACE_SYS_MAX 8
454 #define _POSIX_TRACE_USER_EVENT_MAX 32
455 #define _POSIX_TTY_NAME_MAX 9
456 #define _POSIX_TZNAME_MAX 6
458 #define _POSIX2_BC_BASE_MAX 99
459 #define _POSIX2_BC_DIM_MAX 2048
460 #define _POSIX2_BC_SCALE_MAX 99
461 #define _POSIX2_BC_STRING_MAX 1000
462 #define _POSIX2_COLL_WEIGHTS_MAX 2
463 #define _POSIX2_EXPR_NEST_MAX 32
464 #define _POSIX2_LINE_MAX 2048
465 #define _POSIX2_RE_DUP_MAX 255
467 #define _XOPEN_IOV_MAX 16
468 #define _XOPEN_NAME_MAX 255
469 #define _XOPEN_PATH_MAX 1024
471 /* Other Invariant Values */
474 #define NL_LANGMAX 14
475 #define NL_MSGMAX 32767
476 #define NL_NMAX INT_MAX
477 #define NL_SETMAX 255
478 #define NL_TEXTMAX _POSIX2_LINE_MAX
480 /* Default process priority. */
484 #endif /* _MACH_MACHLIMITS_H_ */
485 #endif /* _LIMITS_H___ */