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