]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/include/limits.h
Define _ALL_SOURCE when generating predefined-macros.txt.
[wasi-libc.git] / libc-top-half / musl / include / limits.h
1 #ifndef _LIMITS_H
2 #define _LIMITS_H
3
4 #include <features.h>
5
6 /* Most limits are system-specific */
7
8 #include <bits/limits.h>
9
10 /* Support signed or unsigned plain-char */
11
12 #if '\xff' > 0
13 #define CHAR_MIN 0
14 #define CHAR_MAX 255
15 #else
16 #define CHAR_MIN (-128)
17 #define CHAR_MAX 127
18 #endif
19
20 /* Some universal constants... */
21
22 #define CHAR_BIT 8
23 #define SCHAR_MIN (-128)
24 #define SCHAR_MAX 127
25 #define UCHAR_MAX 255
26 #define SHRT_MIN (-1-0x7fff)
27 #define SHRT_MAX 0x7fff
28 #define USHRT_MAX 0xffff
29 #define INT_MIN (-1-0x7fffffff)
30 #define INT_MAX 0x7fffffff
31 #define UINT_MAX 0xffffffffU
32 #define LONG_MIN (-LONG_MAX-1)
33 #define ULONG_MAX (2UL*LONG_MAX+1)
34 #define LLONG_MIN (-LLONG_MAX-1)
35 #define ULLONG_MAX (2ULL*LLONG_MAX+1)
36
37 #define MB_LEN_MAX 4
38
39 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
40 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
41
42 #ifdef __wasilibc_unmodified_upstream /* WASI has no pipes */
43 #define PIPE_BUF 4096
44 #endif
45 #define FILESIZEBITS 64
46 #define NAME_MAX 255
47 #define PATH_MAX 4096
48 #define NGROUPS_MAX 32
49 #define ARG_MAX 131072
50 #define IOV_MAX 1024
51 #define SYMLOOP_MAX 40
52 #define WORD_BIT 32
53 #define SSIZE_MAX LONG_MAX
54 #define TZNAME_MAX 6
55 #define TTY_NAME_MAX 32
56 #define HOST_NAME_MAX 255
57
58 /* Implementation choices... */
59
60 #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
61 #define PTHREAD_KEYS_MAX 128
62 #define PTHREAD_STACK_MIN 2048
63 #define PTHREAD_DESTRUCTOR_ITERATIONS 4
64 #endif
65 #ifdef __wasilibc_unmodified_upstream /* WASI has no semaphores */
66 #define SEM_VALUE_MAX 0x7fffffff
67 #define SEM_NSEMS_MAX 256
68 #endif
69 #define DELAYTIMER_MAX 0x7fffffff
70 #ifdef __wasilibc_unmodified_upstream /* WASI has no mq */
71 #define MQ_PRIO_MAX 32768
72 #endif
73 #ifdef __wasilibc_unmodified_upstream /* WASI has no usernames */
74 #define LOGIN_NAME_MAX 256
75 #endif
76
77 /* Arbitrary numbers... */
78
79 #ifdef __wasilibc_unmodified_upstream /* WASI has no shell commands */
80 #define BC_BASE_MAX 99
81 #define BC_DIM_MAX 2048
82 #define BC_SCALE_MAX 99
83 #define BC_STRING_MAX 1000
84 #endif
85 #define CHARCLASS_NAME_MAX 14
86 #define COLL_WEIGHTS_MAX 2
87 #ifdef __wasilibc_unmodified_upstream /* WASI has no shell commands */
88 #define EXPR_NEST_MAX 32
89 #define LINE_MAX 4096
90 #endif
91 #define RE_DUP_MAX 255
92
93 #define NL_ARGMAX 9
94 #define NL_MSGMAX 32767
95 #define NL_SETMAX 255
96 #define NL_TEXTMAX 2048
97
98 #endif
99
100 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
101
102 #ifdef PAGESIZE
103 #define PAGE_SIZE PAGESIZE
104 #endif
105 #define NZERO 20
106 #define NL_LANGMAX 32
107
108 #endif
109
110 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \
111 || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
112
113 #define NL_NMAX 16
114
115 #endif
116
117 /* POSIX/SUS requirements follow. These numbers come directly
118 * from SUS and have nothing to do with the host system. */
119
120 #define _POSIX_AIO_LISTIO_MAX 2
121 #define _POSIX_AIO_MAX 1
122 #define _POSIX_ARG_MAX 4096
123 #define _POSIX_CHILD_MAX 25
124 #define _POSIX_CLOCKRES_MIN 20000000
125 #define _POSIX_DELAYTIMER_MAX 32
126 #define _POSIX_HOST_NAME_MAX 255
127 #define _POSIX_LINK_MAX 8
128 #define _POSIX_LOGIN_NAME_MAX 9
129 #define _POSIX_MAX_CANON 255
130 #define _POSIX_MAX_INPUT 255
131 #define _POSIX_MQ_OPEN_MAX 8
132 #define _POSIX_MQ_PRIO_MAX 32
133 #define _POSIX_NAME_MAX 14
134 #define _POSIX_NGROUPS_MAX 8
135 #define _POSIX_OPEN_MAX 20
136 #define _POSIX_PATH_MAX 256
137 #define _POSIX_PIPE_BUF 512
138 #define _POSIX_RE_DUP_MAX 255
139 #define _POSIX_RTSIG_MAX 8
140 #define _POSIX_SEM_NSEMS_MAX 256
141 #define _POSIX_SEM_VALUE_MAX 32767
142 #define _POSIX_SIGQUEUE_MAX 32
143 #define _POSIX_SSIZE_MAX 32767
144 #define _POSIX_STREAM_MAX 8
145 #define _POSIX_SS_REPL_MAX 4
146 #define _POSIX_SYMLINK_MAX 255
147 #define _POSIX_SYMLOOP_MAX 8
148 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
149 #define _POSIX_THREAD_KEYS_MAX 128
150 #define _POSIX_THREAD_THREADS_MAX 64
151 #define _POSIX_TIMER_MAX 32
152 #define _POSIX_TRACE_EVENT_NAME_MAX 30
153 #define _POSIX_TRACE_NAME_MAX 8
154 #define _POSIX_TRACE_SYS_MAX 8
155 #define _POSIX_TRACE_USER_EVENT_MAX 32
156 #define _POSIX_TTY_NAME_MAX 9
157 #define _POSIX_TZNAME_MAX 6
158 #define _POSIX2_BC_BASE_MAX 99
159 #define _POSIX2_BC_DIM_MAX 2048
160 #define _POSIX2_BC_SCALE_MAX 99
161 #define _POSIX2_BC_STRING_MAX 1000
162 #define _POSIX2_CHARCLASS_NAME_MAX 14
163 #define _POSIX2_COLL_WEIGHTS_MAX 2
164 #define _POSIX2_EXPR_NEST_MAX 32
165 #define _POSIX2_LINE_MAX 2048
166 #define _POSIX2_RE_DUP_MAX 255
167
168 #define _XOPEN_IOV_MAX 16
169 #define _XOPEN_NAME_MAX 255
170 #define _XOPEN_PATH_MAX 1024
171
172 #endif