Debian Codegraph @

libc-top-half/musl/include/limits.h

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