Print this page
8527 tty buffer/queue sizes should be larger
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/limits.h
+++ new/usr/src/head/limits.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2013 Gary Mills
24 24 * Copyright 2017 RackTop Systems.
25 25 *
26 26 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
27 27 * Use is subject to license terms.
28 28 */
29 29
30 30 /* Copyright (c) 1988 AT&T */
31 31 /* All Rights Reserved */
32 32
33 33
34 34 #ifndef _LIMITS_H
35 35 #define _LIMITS_H
36 36
37 37 #include <sys/feature_tests.h>
38 38 #include <sys/isa_defs.h>
39 39 #include <iso/limits_iso.h>
40 40
41 41 /*
42 42 * Include fixed width type limits as proposed by the ISO/JTC1/SC22/WG14 C
43 43 * committee's working draft for the revision of the current ISO C standard,
44 44 * ISO/IEC 9899:1990 Programming language - C. These are not currently
45 45 * required by any standard but constitute a useful, general purpose set
46 46 * of type definitions and limits which is namespace clean with respect to
47 47 * all standards.
48 48 */
49 49 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
50 50 defined(__XOPEN_OR_POSIX)
51 51 #include <sys/int_limits.h>
52 52 #endif
53 53
54 54 #ifdef __cplusplus
55 55 extern "C" {
56 56 #endif
57 57
58 58 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
59 59 defined(__XOPEN_OR_POSIX)
60 60
61 61 #define SSIZE_MAX LONG_MAX /* max value of an "ssize_t" */
62 62
63 63 /*
64 64 * ARG_MAX is calculated as follows:
65 65 * NCARGS - space for other stuff on initial stack
↓ open down ↓ |
65 lines elided |
↑ open up ↑ |
66 66 * like aux vectors, saved registers, etc..
67 67 */
68 68 #define _ARG_MAX32 1048320 /* max length of args to exec 32-bit program */
69 69 #define _ARG_MAX64 2096640 /* max length of args to exec 64-bit program */
70 70 #ifdef _LP64
71 71 #define ARG_MAX _ARG_MAX64 /* max length of arguments to exec */
72 72 #else /* _LP64 */
73 73 #define ARG_MAX _ARG_MAX32 /* max length of arguments to exec */
74 74 #endif /* _LP64 */
75 75
76 +
77 +/*
78 + * These two symbols have their historical values, the actual buffer is
79 + * larger.
80 + */
76 81 #ifndef MAX_CANON
77 82 #define MAX_CANON 256 /* max bytes in line for canonical processing */
78 83 #endif
79 84
80 85 #ifndef MAX_INPUT
81 86 #define MAX_INPUT 512 /* max size of a char input buffer */
82 87 #endif
83 88
84 89 #define NGROUPS_MAX 16 /* max number of groups for a user */
85 90
86 91 #ifndef PATH_MAX
87 92 #define PATH_MAX 1024 /* max # of characters in a path name */
88 93 #endif
89 94
90 95 #define SYMLINK_MAX 1024 /* max # of characters a symlink can contain */
91 96
92 97 #define PIPE_BUF 5120 /* max # bytes atomic in write to a pipe */
93 98
94 99 #ifndef TMP_MAX
95 100 #define TMP_MAX 17576 /* 26 * 26 * 26 */
96 101 #endif
97 102
98 103 /*
99 104 * POSIX conformant definitions - An implementation may define
100 105 * other symbols which reflect the actual implementation. Alternate
101 106 * definitions may not be as restrictive as the POSIX definitions.
102 107 */
103 108 #define _POSIX_AIO_LISTIO_MAX 2
104 109 #define _POSIX_AIO_MAX 1
105 110 #define _POSIX_ARG_MAX 4096
106 111 #ifdef _XPG6
107 112 #define _POSIX_CHILD_MAX 25
108 113 #else
109 114 #define _POSIX_CHILD_MAX 6 /* POSIX.1-1990 default */
110 115 #endif
111 116 #define _POSIX_CLOCKRES_MIN 20000000
112 117 #define _POSIX_DELAYTIMER_MAX 32
113 118 #define _POSIX_LINK_MAX 8
114 119 #define _POSIX_MAX_CANON 255
115 120 #define _POSIX_MAX_INPUT 255
116 121 #define _POSIX_MQ_OPEN_MAX 8
117 122 #define _POSIX_MQ_PRIO_MAX 32
118 123 #define _POSIX_NAME_MAX 14
119 124 #ifdef _XPG6
120 125 #define _POSIX_NGROUPS_MAX 8
121 126 #define _POSIX_OPEN_MAX 20
122 127 #define _POSIX_PATH_MAX 256
123 128 #else /* POSIX.1-1990 defaults */
124 129 #define _POSIX_NGROUPS_MAX 0
125 130 #define _POSIX_OPEN_MAX 16
126 131 #define _POSIX_PATH_MAX 255
127 132 #endif
128 133 #define _POSIX_PIPE_BUF 512
129 134 #define _POSIX_RTSIG_MAX 8
130 135 #define _POSIX_SEM_NSEMS_MAX 256
131 136 #define _POSIX_SEM_VALUE_MAX 32767
132 137 #define _POSIX_SIGQUEUE_MAX 32
133 138 #define _POSIX_SSIZE_MAX 32767
134 139 #define _POSIX_STREAM_MAX 8
135 140 #define _POSIX_TIMER_MAX 32
136 141 #ifdef _XPG6
137 142 #define _POSIX_TZNAME_MAX 6
138 143 #else
139 144 #define _POSIX_TZNAME_MAX 3 /* POSIX.1-1990 default */
140 145 #endif
141 146 /* POSIX.1c conformant */
142 147 #define _POSIX_LOGIN_NAME_MAX 9
143 148 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
144 149 #define _POSIX_THREAD_KEYS_MAX 128
145 150 #define _POSIX_THREAD_THREADS_MAX 64
146 151 #define _POSIX_TTY_NAME_MAX 9
147 152 /* UNIX 03 conformant */
148 153 #define _POSIX_HOST_NAME_MAX 255
149 154 #define _POSIX_RE_DUP_MAX 255
150 155 #define _POSIX_SYMLINK_MAX 255
151 156 #define _POSIX_SYMLOOP_MAX 8
152 157
153 158 /*
154 159 * POSIX.2 and XPG4-XSH4 conformant definitions
155 160 */
156 161
157 162 #define _POSIX2_BC_BASE_MAX 99
158 163 #define _POSIX2_BC_DIM_MAX 2048
159 164 #define _POSIX2_BC_SCALE_MAX 99
160 165 #define _POSIX2_BC_STRING_MAX 1000
161 166 #define _POSIX2_COLL_WEIGHTS_MAX 2
162 167 #define _POSIX2_EXPR_NEST_MAX 32
163 168 #define _POSIX2_LINE_MAX 2048
164 169 #define _POSIX2_RE_DUP_MAX 255
165 170 /* UNIX 03 conformant */
166 171 #define _POSIX2_CHARCLASS_NAME_MAX 14
167 172
168 173 #define BC_BASE_MAX _POSIX2_BC_BASE_MAX
169 174 #define BC_DIM_MAX _POSIX2_BC_DIM_MAX
170 175 #define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
171 176 #define BC_STRING_MAX _POSIX2_BC_STRING_MAX
172 177 #define COLL_WEIGHTS_MAX 10
173 178 #define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
174 179 #define LINE_MAX _POSIX2_LINE_MAX
175 180 #if !defined(_XPG6)
176 181 #define RE_DUP_MAX _POSIX2_RE_DUP_MAX
177 182 #else
178 183 #define RE_DUP_MAX _POSIX_RE_DUP_MAX
179 184 #endif /* !defined(_XPG6) */
180 185
181 186 #endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
182 187
183 188 #if defined(__EXTENSIONS__) || \
184 189 (!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
185 190 defined(_XOPEN_SOURCE)
186 191
187 192 /*
188 193 * For dual definitions for PASS_MAX and sysconf.c
189 194 */
190 195 #define _PASS_MAX_XPG 8 /* old standards PASS_MAX */
191 196 #define _PASS_MAX 256 /* modern Solaris PASS_MAX */
192 197
193 198 #if defined(_XPG3) && !defined(_XPG6)
194 199 #define PASS_MAX _PASS_MAX_XPG /* max # of characters in a password */
195 200 #else /* XPG6 or just Solaris */
196 201 #define PASS_MAX _PASS_MAX /* max # of characters in a password */
197 202 #endif /* defined(_XPG3) && !defined(_XPG6) */
198 203
199 204 #define CHARCLASS_NAME_MAX _POSIX2_CHARCLASS_NAME_MAX
200 205
201 206 #define NL_ARGMAX 9 /* max value of "digit" in calls to the */
202 207 /* NLS printf() and scanf() */
203 208 #define NL_LANGMAX 14 /* max # of bytes in a LANG name */
204 209 #define NL_MSGMAX 32767 /* max message number */
205 210 #define NL_NMAX 1 /* max # bytes in N-to-1 mapping characters */
206 211 #define NL_SETMAX 255 /* max set number */
207 212 #define NL_TEXTMAX 2048 /* max set number */
208 213 #define NZERO 20 /* default process priority */
209 214
210 215 #define WORD_BIT 32 /* # of bits in a "word" or "int" */
211 216 #if defined(_LP64)
212 217 #define LONG_BIT 64 /* # of bits in a "long" */
213 218 #else /* _ILP32 */
214 219 #define LONG_BIT 32 /* # of bits in a "long" */
215 220 #endif
216 221
217 222 /* Marked as LEGACY in SUSv2 and removed in UNIX 03 */
218 223 #ifndef _XPG6
219 224 #define DBL_DIG 15 /* digits of precision of a "double" */
220 225 #define DBL_MAX 1.7976931348623157081452E+308 /* max decimal value */
221 226 /* of a double */
222 227 #define FLT_DIG 6 /* digits of precision of a "float" */
223 228 #define FLT_MAX 3.4028234663852885981170E+38F /* max decimal value */
224 229 /* of a "float" */
225 230 #endif
226 231
227 232 /* Marked as LEGACY in SUSv1 and removed in SUSv2 */
228 233 #ifndef _XPG5
229 234 #define DBL_MIN 2.2250738585072013830903E-308 /* min decimal value */
230 235 /* of a double */
231 236 #define FLT_MIN 1.1754943508222875079688E-38F /* min decimal value */
232 237 /* of a float */
233 238 #endif
234 239
235 240 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
236 241
237 242 #define _XOPEN_IOV_MAX 16 /* max # iovec/process with readv()/writev() */
238 243 #define _XOPEN_NAME_MAX 255 /* max # bytes in filename excluding null */
239 244 #define _XOPEN_PATH_MAX 1024 /* max # bytes in a pathname */
240 245
241 246 #define IOV_MAX _XOPEN_IOV_MAX
242 247
243 248 #if defined(__EXTENSIONS__) || \
244 249 (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
245 250
246 251 #define FCHR_MAX 1048576 /* max size of a file in bytes */
247 252 #define PID_MAX 999999 /* max value for a process ID */
248 253
249 254 /*
250 255 * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
251 256 * related text states:
252 257 *
253 258 * A definition of one of the values from Table 2-5 shall be omitted from the
254 259 * <limits.h> on specific implementations where the corresponding value is
255 260 * equal to or greater than the stated minimum, but where the value can vary
256 261 * depending on the file to which it is applied. The actual value supported for
257 262 * a specific pathname shall be provided by the pathconf() (5.7.1) function.
258 263 *
259 264 * This is clear that any machine supporting multiple file system types
260 265 * and/or a network should not include this define, regardless of protection
261 266 * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags. We chose to ignore that
262 267 * and provide it anyway for compatibility with other platforms that don't
263 268 * follow the spec as precisely as they should. Its usage is discouraged.
264 269 */
265 270 #define NAME_MAX 255
266 271
267 272 #define CHILD_MAX 25 /* max # of processes per user id */
268 273 #ifndef OPEN_MAX
269 274 #define OPEN_MAX 256 /* max # of files a process can have open */
270 275 #endif
271 276
272 277 #define PIPE_MAX 5120 /* max # bytes written to a pipe in a write */
273 278
274 279 #define STD_BLK 1024 /* # bytes in a physical I/O block */
275 280 #define UID_MAX 2147483647 /* max value for a user or group ID */
276 281 #define USI_MAX 4294967295 /* max decimal value of an "unsigned" */
277 282 #define SYSPID_MAX 1 /* max pid of system processes */
278 283
279 284 #ifndef SYS_NMLN /* also defined in sys/utsname.h */
280 285 #define SYS_NMLN 257 /* 4.0 size of utsname elements */
281 286 #endif
282 287
283 288 #ifndef CLK_TCK
284 289
285 290 #if !defined(_CLOCK_T) || __cplusplus >= 199711L
286 291 #define _CLOCK_T
287 292 typedef long clock_t;
288 293 #endif /* !_CLOCK_T */
289 294
290 295 extern long _sysconf(int); /* System Private interface to sysconf() */
291 296 #define CLK_TCK ((clock_t)_sysconf(3)) /* 3 is _SC_CLK_TCK */
292 297
293 298 #endif /* CLK_TCK */
294 299
295 300 #ifdef __USE_LEGACY_LOGNAME__
296 301 #define LOGNAME_MAX 8 /* max # of characters in a login name */
297 302 #else /* __USE_LEGACY_LOGNAME__ */
298 303 #define LOGNAME_MAX 32 /* max # of characters in a login name */
299 304 /* Increased for illumos */
300 305 #endif /* __USE_LEGACY_LOGNAME__ */
301 306 #define LOGIN_NAME_MAX (LOGNAME_MAX + 1) /* max buffer size */
302 307 #define LOGNAME_MAX_TRAD 8 /* traditional length */
303 308 #define LOGIN_NAME_MAX_TRAD (LOGNAME_MAX_TRAD + 1) /* and size */
304 309
305 310 #define TTYNAME_MAX 128 /* max # of characters in a tty name */
306 311
307 312 #endif /* if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
308 313
309 314 #if defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L)
310 315 #include <sys/unistd.h>
311 316
312 317 #if !defined(_SIZE_T) || __cplusplus >= 199711L
313 318 #define _SIZE_T
314 319 #if defined(_LP64) || defined(_I32LPx)
315 320 typedef unsigned long size_t; /* size of something in bytes */
316 321 #else
317 322 typedef unsigned int size_t; /* (historical version) */
318 323 #endif
319 324 #endif /* _SIZE_T */
320 325
321 326 extern long _sysconf(int); /* System Private interface to sysconf() */
322 327
323 328 #define PTHREAD_STACK_MIN ((size_t)_sysconf(_SC_THREAD_STACK_MIN))
324 329 /* Added for UNIX98 conformance */
325 330 #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
326 331 #define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
327 332 #define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
328 333 #endif /* defined(__EXTENSIONS__) || (_POSIX_C_SOURCE >= 199506L) */
329 334
330 335 #ifdef __cplusplus
331 336 }
332 337 #endif
333 338
334 339 #endif /* _LIMITS_H */
↓ open down ↓ |
249 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX