make includes fix from trunk
[minix.git] / include / limits.h
blob60503af3ff414deb287209288c17617024dbd56e
1 /* The <limits.h> header defines some basic sizes, both of the language types
2 * (e.g., the number of bits in an integer), and of the operating system (e.g.
3 * the number of characters in a file name.
4 */
6 #ifndef _LIMITS_H
7 #define _LIMITS_H
9 /* Definitions about chars (8 bits in MINIX, and signed). */
10 #define CHAR_BIT 8 /* # bits in a char */
11 #define CHAR_MIN -128 /* minimum value of a char */
12 #define CHAR_MAX 127 /* maximum value of a char */
13 #define SCHAR_MIN -128 /* minimum value of a signed char */
14 #define SCHAR_MAX 127 /* maximum value of a signed char */
15 #define UCHAR_MAX 255 /* maximum value of an unsigned char */
16 #define MB_LEN_MAX 1 /* maximum length of a multibyte char */
18 /* Definitions about shorts (16 bits in MINIX). */
19 #define SHRT_MIN (-32767-1) /* minimum value of a short */
20 #define SHRT_MAX 32767 /* maximum value of a short */
21 #define USHRT_MAX 0xFFFF /* maximum value of unsigned short */
23 /* _EM_WSIZE is a compiler-generated symbol giving the word size in bytes. */
24 #if _EM_WSIZE == 2
25 #define INT_MIN (-32767-1) /* minimum value of a 16-bit int */
26 #define INT_MAX 32767 /* maximum value of a 16-bit int */
27 #define UINT_MAX 0xFFFF /* maximum value of an unsigned 16-bit int */
28 #endif
30 #if _EM_WSIZE == 4
31 #define INT_MIN (-2147483647-1) /* minimum value of a 32-bit int */
32 #define INT_MAX 2147483647 /* maximum value of a 32-bit int */
33 #define UINT_MAX 0xFFFFFFFF /* maximum value of an unsigned 32-bit int */
34 #endif
36 /*Definitions about longs (32 bits in MINIX). */
37 #define LONG_MIN (-2147483647L-1)/* minimum value of a long */
38 #define LONG_MAX 2147483647L /* maximum value of a long */
39 #define ULONG_MAX 0xFFFFFFFFL /* maximum value of an unsigned long */
41 /*Definitions about long longs (64 bits, may not be supported). */
42 #ifdef __LONG_LONG_SUPPORTED
43 #define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL-1) /* minimum value of a
44 * long long
46 #define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL /* maximum value of a
47 * long long
49 #define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL /* maximum value of an
50 * unsigned long long
52 #endif
54 #include <minix/dir.h>
56 /* Minimum sizes required by the POSIX P1003.1 standard (Table 2-3). */
57 #ifdef _POSIX_SOURCE /* these are only visible for POSIX */
58 #define _POSIX_ARG_MAX 4096 /* exec() may have 4K worth of args */
59 #define _POSIX_CHILD_MAX 6 /* a process may have 6 children */
60 #define _POSIX_LINK_MAX 8 /* a file may have 8 links */
61 #define _POSIX_MAX_CANON 255 /* size of the canonical input queue */
62 #define _POSIX_MAX_INPUT 255 /* you can type 255 chars ahead */
63 #define _POSIX_NAME_MAX DIRSIZ /* max. file name length */
64 #define _POSIX_NGROUPS_MAX 8 /* max. number of supplemental groups */
65 #define _POSIX_OPEN_MAX 16 /* a process may have 16 files open */
66 #define _POSIX_PATH_MAX 255 /* a pathname may contain 255 chars */
67 #define _POSIX_PIPE_BUF 512 /* pipes writes of 512 bytes must be atomic */
68 #define _POSIX_STREAM_MAX 8 /* at least 8 FILEs can be open at once */
69 #define _POSIX_TZNAME_MAX 3 /* time zone names can be at least 3 chars */
70 #define _POSIX_SSIZE_MAX 32767 /* read() must support 32767 byte reads */
71 #define _POSIX_SYMLOOP_MAX 8 /* The number of symbolic links that can be
72 * traversed in the resolution of a pathname
73 * in the absence of a loop.
75 #define _POSIX_SYMLINK_MAX 255 /* The number of bytes in a symbolic link */
77 /* Values actually implemented by MINIX (Tables 2-4, 2-5, 2-6, and 2-7). */
78 /* Some of these old names had better be defined when not POSIX. */
79 #define _NO_LIMIT 100 /* arbitrary number; limit not enforced */
81 #define NGROUPS_MAX 8 /* max. number of supplemental groups */
82 #if _EM_WSIZE > 2
83 #define ARG_MAX 262144 /* # bytes of args + environ for exec() */
84 #else
85 #define ARG_MAX 4096 /* args + environ on small machines */
86 #endif
87 #define CHILD_MAX _NO_LIMIT /* MINIX does not limit children */
88 #define OPEN_MAX 30 /* # open files a process may have */
89 #if 0 /* V1 file system */
90 #define LINK_MAX CHAR_MAX /* # links a file may have */
91 #else /* V2 or better file system */
92 #define LINK_MAX SHRT_MAX /* # links a file may have */
93 #endif
94 #define MAX_CANON 255 /* size of the canonical input queue */
95 #define MAX_INPUT 255 /* size of the type-ahead buffer */
96 #define NAME_MAX DIRSIZ /* # chars in a file name */
97 #define PATH_MAX 255 /* # chars in a path name */
98 #define PIPE_BUF 7168 /* # bytes in atomic write to a pipe */
99 #define STREAM_MAX 20 /* must be the same as FOPEN_MAX in stdio.h */
100 #define TZNAME_MAX 3 /* maximum bytes in a time zone name is 3 */
101 #define SSIZE_MAX 32767 /* max defined byte count for read() */
102 #define SYMLINK_MAX 1024 /* # bytes in a symbolic link */
103 #define SYMLOOP_MAX 16 /* maximum number of symbolic links that can
104 * be reliably traversed in the resolution of
105 * a pathname in the absence of a loop.
107 #define IOV_MAX INT_MAX /* maximum number of buffers for readv/writev */
108 #endif /* _POSIX_SOURCE */
110 #endif /* _LIMITS_H */