OSDN Git Service

* Makefile.in (DLL_OFILES): Add posix_ipc.o.
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygwin / include / limits.h
1 /* limits.h
2
3    Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
4
5 This file is part of Cygwin.
6
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
9 details. */
10
11 #ifndef _LIMITS_H___
12
13 #include <features.h>
14
15 #ifndef _MACH_MACHLIMITS_H_
16
17 /* _MACH_MACHLIMITS_H_ is used on OSF/1.  */
18 #define _LIMITS_H___
19 #define _MACH_MACHLIMITS_H_
20
21
22 /* Numerical limits */
23
24 /* Number of bits in a `char'.  */
25 #undef CHAR_BIT
26 #define CHAR_BIT 8
27
28 /* Maximum length of a multibyte character.  */
29 #ifndef MB_LEN_MAX
30 #define MB_LEN_MAX 1
31 #endif
32
33 /* Minimum and maximum values a `signed char' can hold.  */
34 #undef SCHAR_MIN
35 #define SCHAR_MIN (-128)
36 #undef SCHAR_MAX
37 #define SCHAR_MAX 127
38
39 /* Maximum value an `unsigned char' can hold.  (Minimum is 0).  */
40 #undef UCHAR_MAX
41 #define UCHAR_MAX 255
42
43 /* Minimum and maximum values a `char' can hold.  */
44 #ifdef __CHAR_UNSIGNED__
45 #undef CHAR_MIN
46 #define CHAR_MIN 0
47 #undef CHAR_MAX
48 #define CHAR_MAX 255
49 #else
50 #undef CHAR_MIN
51 #define CHAR_MIN (-128)
52 #undef CHAR_MAX
53 #define CHAR_MAX 127
54 #endif
55
56 /* Minimum and maximum values a `signed short int' can hold.  */
57 #undef SHRT_MIN
58 #define SHRT_MIN (-32768)
59 #undef SHRT_MAX
60 #define SHRT_MAX 32767
61
62 /* Maximum value an `unsigned short int' can hold.  (Minimum is 0).  */
63 #undef USHRT_MAX
64 #define USHRT_MAX 65535
65
66 /* Minimum and maximum values a `signed int' can hold.  */
67 #ifndef __INT_MAX__
68 #define __INT_MAX__ 2147483647
69 #endif
70 #undef INT_MIN
71 #define INT_MIN (-INT_MAX-1)
72 #undef INT_MAX
73 #define INT_MAX __INT_MAX__
74
75 /* Maximum value an `unsigned int' can hold.  (Minimum is 0).  */
76 #undef UINT_MAX
77 #define UINT_MAX (INT_MAX * 2U + 1)
78
79 /* Minimum and maximum values a `signed long int' can hold.
80    (Same as `int').  */
81 #ifndef __LONG_MAX__
82 #ifndef __alpha__
83 #define __LONG_MAX__ 2147483647L
84 #else
85 #define __LONG_MAX__ 9223372036854775807L
86 # endif /* __alpha__ */
87 #endif
88 #undef LONG_MIN
89 #define LONG_MIN (-LONG_MAX-1)
90 #undef LONG_MAX
91 #define LONG_MAX __LONG_MAX__
92
93 /* Maximum value an `unsigned long int' can hold.  (Minimum is 0).  */
94 #undef ULONG_MAX
95 #define ULONG_MAX (LONG_MAX * 2UL + 1)
96
97 /* Minimum and maximum values a `signed long long int' can hold.  */
98 #ifndef __LONG_LONG_MAX__
99 #define __LONG_LONG_MAX__ 9223372036854775807LL
100 #endif
101
102 #if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
103 #undef LONG_LONG_MIN
104 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
105 #undef LONG_LONG_MAX
106 #define LONG_LONG_MAX __LONG_LONG_MAX__
107
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)
111 #endif
112
113 /* Minimum and maximum values a `signed long long int' can hold.  */
114 #undef LLONG_MIN
115 #define LLONG_MIN (-LLONG_MAX-1)
116 #undef LLONG_MAX
117 #define LLONG_MAX __LONG_LONG_MAX__
118
119 /* Maximum value an `unsigned long long int' can hold.  (Minimum is 0).  */
120 #undef ULLONG_MAX
121 #define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
122
123 /* Maximum size of ssize_t */
124 #undef SSIZE_MAX
125 #define SSIZE_MAX (__LONG_MAX__)
126
127
128 /* Runtime Invariant Values */
129
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. */
136
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 */
141
142 /* Maximum number of outstanding asynchronous I/O operations supported by
143    the implementation.  Not yet implemented. */
144 #undef AIO_MAX
145 /*  #define AIO_MAX >= _POSIX_AIO_MAX */
146
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 */
151
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. */
155 #undef ARG_MAX
156 #define ARG_MAX 32000
157
158 /* Maximum number of functions that may be registered with atexit(). */
159 #undef ATEXIT_MAX
160 #define ATEXIT_MAX 32
161
162 /* Maximum number of simultaneous processes per real user ID. */
163 #undef CHILD_MAX
164 #define CHILD_MAX 256
165
166 /* Maximum number of timer expiration overruns.  Not yet implemented. */
167 #undef DELAYTIMER_MAX
168 /* #define DELAYTIMER_MAX >= _POSIX_DELAYTIMER_MAX */
169
170 /* Maximum length of a host name. */
171 #undef HOST_NAME_MAX
172 #define HOST_NAME_MAX 255
173
174 /* Maximum number of iovcnt in a writev (an arbitrary number) */
175 #undef IOV_MAX
176 #define IOV_MAX 1024
177
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 */
181
182 /* The maximum number of open message queue descriptors a process may hold. */
183 #undef MQ_OPEN_MAX
184 #define MQ_OPEN_MAX OPEN_MAX
185
186 /* The maximum number of message priorities supported by the implementation. */
187 #undef MQ_PRIO_MAX
188 #define MQ_PRIO_MAX INT_MAX
189
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). */
194 #undef OPEN_MAX
195 #define OPEN_MAX 256
196
197 /* Size in bytes of a page. */
198 #undef PAGESIZE
199 #undef PAGE_SIZE
200 #define PAGESIZE 65536
201 #define PAGE_SIZE PAGESIZE
202
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
212
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
217
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
228
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 */
233
234 /* Maximum number of realtime signals reserved for application use. */
235 /* FIXME: We only support one realtime signal but _POSIX_RTSIG_MAX is 8. */
236 #undef RTSIG_MAX
237 #define RTSIG_MAX 1
238
239 /* Maximum number of semaphores that a process may have. */
240 /* Windows allows any arbitrary number of semaphores per process. */
241 #undef SEM_NSEMS_MAX
242 /* #define SEM_NSEMS_MAX unspecified */
243
244 /* The maximum value a semaphore may have. */
245 #undef SEM_VALUE_MAX
246 #define SEM_VALUE_MAX 1147483648
247
248 /* Maximum number of queued signals that a process may send and have pending
249    at the receiver(s) at any time. */
250 #undef SIGQUEUE_MAX
251 #define SIGQUEUE_MAX 32
252
253 /* The maximum number of replenishment operations that may be simultaneously
254    pending for a particular sporadic server scheduler.  Not implemented. */
255 #undef SS_REPL_MAX
256 /* #define SS_REPL_MAX >= _POSIX_SS_REPL_MAX */
257
258 /* Number of streams that one process can have open at one time. */
259 #undef STREAM_MAX
260 #define STREAM_MAX 20
261
262 /* Maximum number of nested symbolic links. */
263 #undef SYMLOOP_MAX
264 #define SYMLOOP_MAX 10
265
266 /* Maximum number of timer expiration overruns. */
267 #undef TIMER_MAX
268 #define TIMER_MAX 32
269
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 */
273
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 */
278
279 /* Maximum number of trace streams that may simultaneously exist in the
280    system.  Not implemented. */
281 #undef TRACE_SYS_MAX
282 /* #define TRACE_SYS_MAX >= _POSIX_TRACE_SYS_MAX */
283
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 */
289
290 /* Maximum number of characters in a tty name. */
291 #undef TTY_NAME_MAX
292 #define TTY_NAME_MAX 12
293
294 /* Maximum number of bytes supported for the name of a timezone (not of the TZ variable).  Not implemented. */
295 #undef TZNAME_MAX
296 /* #define TZNAME_MAX >= _POSIX_TZNAME_MAX */
297
298
299 /* Pathname Variable Values */
300
301 /* Minimum bits needed to represent the maximum size of a regular file. */
302 #undef FILESIZEBITS
303 #define FILESIZEBITS 64
304
305 /* Maximum number of hardlinks to a file. */
306 #undef LINK_MAX
307 #define LINK_MAX 1024
308
309 /* Maximum number of bytes in a terminal canonical input line. */
310 #undef MAX_CANON
311 #define MAX_CANON 255
312
313 /* Minimum number of bytes available in a terminal input queue. */
314 #undef MAX_INPUT
315 #define MAX_INPUT 255
316
317 /* Maximum length of a path component. */
318 #undef NAME_MAX
319 #define NAME_MAX 255
320
321 /* Maximum length of a path */
322 #undef PATH_MAX
323 #define PATH_MAX 260
324
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. */
327 #undef PIPE_BUF
328 #define PIPE_BUF 4096
329
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 */
334
335 /* Recommended increment for file transfer sizes between the
336    {POSIX_REC_MIN_XFER_SIZE} and {POSIX_REC_MAX_XFER_SIZE} values.
337    Not implemented. */
338 #undef POSIX_REC_INCR_XFER_SIZE
339 /* #define POSIX_REC_INCR_XFER_SIZE unspecifed */
340
341 /* Maximum recommended file transfer size.  Not implemented. */
342 #undef POSIX_REC_MAX_XFER_SIZE
343 /* #define POSIX_REC_MAX_XFER_SIZE unspecifed */
344
345 /* Minimum recommended file transfer size.  Not implemented. */
346 #undef POSIX_REC_MIN_XFER_SIZE
347 /* #define POSIX_REC_MIN_XFER_SIZE unspecifed */
348
349 /* Recommended file transfer buffer alignment.  Not implemented. */
350 #undef POSIX_REC_XFER_ALIGN
351 /* #define POSIX_REC_XFER_ALIGN unspecifed */
352
353 /* Maximum number of bytes in a symbolic link. */
354 #undef SYMLINK_MAX
355 #define SYMLINK_MAX PATH_MAX
356
357
358 /* Runtime Increasable Values */
359
360 /* Maximum obase values allowed by the bc utility. */
361 #undef BC_BASE_MAX
362 #define BC_BASE_MAX 99
363
364 /* Maximum number of elements permitted in an array by the bc utility. */
365 #undef BC_DIM_MAX
366 #define BC_DIM_MAX 2048
367
368 /* Maximum scale value allowed by the bc utility. */
369 #undef BC_SCALE_MAX
370 #define BC_SCALE_MAX 99
371
372 /* Maximum length of a string constant accepted by the bc utility. */
373 #undef BC_STRING_MAX
374 #define BC_STRING_MAX 1000
375
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 */
379
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 */
388
389 /* Maximum number of expressions that can be nested within parentheses
390    by the expr utility. */
391 #undef EXPR_NEST_MAX
392 #define EXPR_NEST_MAX 32
393
394 /* Maximum bytes of a text utility's input line */
395 #undef LINE_MAX
396 #define LINE_MAX 2048
397
398 /* Max num groups for a user, value taken from NT documentation */
399 /* Must match <sys/param.h> NGROUPS */
400 #undef NGROUPS_MAX
401 #define NGROUPS_MAX 16
402
403 /* Maximum number of repeated occurrences of a regular expression when
404    using the interval notation \{m,n\} */
405 #undef RE_DUP_MAX
406 #define RE_DUP_MAX 255
407
408
409 /* POSIX values */
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. */
413
414 /* Maximum Values */
415
416 #define _POSIX_CLOCKRES_MIN                 20000000
417
418 /* Minimum Values */
419
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
457
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
466
467 #define _XOPEN_IOV_MAX                            16
468 #define _XOPEN_NAME_MAX                          255
469 #define _XOPEN_PATH_MAX                         1024
470
471 /* Other Invariant Values */
472
473 #define NL_ARGMAX                                  9
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
479
480 /* Default process priority. */
481 #undef NZERO
482 #define NZERO                                     20
483
484 #endif /* _MACH_MACHLIMITS_H_ */
485 #endif /* _LIMITS_H___ */