Print this page
8527 tty buffer/queue sizes should be larger
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/param.h
+++ new/usr/src/uts/common/sys/param.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 2014 Nexenta Systems, Inc. All rights reserved.
24 24 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
25 25 */
26 26
27 27 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
28 28 /* All Rights Reserved */
29 29
30 30 /*
31 31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 32 * The Regents of the University of California
33 33 * All Rights Reserved
34 34 *
35 35 * University Acknowledgment- Portions of this document are derived from
36 36 * software developed by the University of California, Berkeley, and its
37 37 * contributors.
38 38 */
39 39
40 40 #ifndef _SYS_PARAM_H
41 41 #define _SYS_PARAM_H
42 42
43 43 #ifndef _ASM /* Avoid typedef headaches for assembly files */
44 44 #include <sys/types.h>
45 45 #include <sys/isa_defs.h>
46 46 #endif /* _ASM */
47 47
48 48 #include <sys/null.h>
49 49
50 50 #ifdef __cplusplus
51 51 extern "C" {
52 52 #endif
53 53
54 54 /*
55 55 * Fundamental variables; don't change too often.
56 56 */
57 57
58 58 /*
59 59 * _POSIX_VDISABLE has historically been defined in <sys/param.h> since
60 60 * an early merge with AT&T source. It has also historically been defined
61 61 * in <sys/termios.h>. The POSIX standard, IEEE Std. 1003.1-1988 initially
62 62 * required the existence of _POSIX_VDISABLE in <sys/termios.h>.
63 63 * Subsequent versions of the IEEE Standard as well as the X/Open
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
64 64 * specifications required that _POSIX_VDISABLE be defined in <unistd.h>
65 65 * while still allowing for it's existence in other headers. With the
66 66 * introduction of XPG6, _POSIX_VDISABLE can only be defined in <unistd.h>.
67 67 */
68 68 #if !defined(_XPG6) || defined(__EXTENSIONS__)
69 69 #ifndef _POSIX_VDISABLE
70 70 #define _POSIX_VDISABLE 0 /* Disable special character functions */
71 71 #endif
72 72 #endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
73 73
74 +/* The actual size of the TTY input queue */
75 +#define _TTY_BUFSIZ 2048
76 +
77 +/*
78 + * These defines all have their historical value. The actual size of the tty
79 + * buffer both for the line-editor in ldterm, and in general, is above as
80 + * _TTY_BUFSIZ.
81 + *
82 + * We leave these defines at their historical value to match the behaviour of
83 + * BSD and Linux.
84 + */
74 85 #ifndef MAX_INPUT
75 86 #define MAX_INPUT 512 /* Maximum bytes stored in the input queue */
76 87 #endif
77 -
78 88 #ifndef MAX_CANON
79 89 #define MAX_CANON 256 /* Maximum bytes for canonical processing */
80 90 #endif
91 +#define CANBSIZ 256 /* max size of typewriter line */
92 +
81 93
82 94 #define UID_NOBODY 60001 /* user ID no body */
83 95 #define GID_NOBODY UID_NOBODY
84 96 #define UID_UNKNOWN 96
85 97 #define GID_UNKNOWN UID_UNKNOWN
86 98 #define UID_DLADM 15
87 99 #define UID_NETADM 16
88 100 #define GID_NETADM 65
89 101 #define UID_NOACCESS 60002 /* user ID no access */
90 102
91 103 #ifdef _KERNEL
92 104 #define MAX_TASKID 999999
93 105 #define MAX_MAXPID 999999
94 106 #define MAXEPHUID 0xfffffffcu /* max ephemeral user id */
95 107
96 108 #define FAMOUS_PID_SCHED 0
97 109 #define FAMOUS_PID_INIT 1
98 110 #define FAMOUS_PID_PAGEOUT 2
99 111 #define FAMOUS_PID_FSFLUSH 3
100 112 #define FAMOUS_PIDS 4
101 113 #endif
102 114
103 115 #ifdef DEBUG
104 116 #define DEFAULT_MAXPID 999999
105 117 #define DEFAULT_JUMPPID 100000
106 118 #else
107 119 #define DEFAULT_MAXPID 30000
108 120 #define DEFAULT_JUMPPID 0
109 121 #endif
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
110 122
111 123 #define MAXUID 2147483647 /* max user id */
112 124
113 125 #define MAXPROJID MAXUID /* max project id */
114 126 #define MAXLINK 32767 /* max links */
115 127
116 128 #define MINEPHUID 0x80000000u /* min ephemeral user id */
117 129
118 130 #define NMOUNT 40 /* est. of # mountable fs for quota calc */
119 131
120 -#define CANBSIZ 256 /* max size of typewriter line */
121 -
122 132 #define NOFILE 20 /* this define is here for */
123 133 /* compatibility purposes only */
124 134 /* and will be removed in a */
125 135 /* later release */
126 136
127 137 /*
128 138 * These define the maximum and minimum allowable values of the
129 139 * configurable parameter NGROUPS_MAX.
130 140 */
131 141 #define NGROUPS_UMIN 0
132 142 #define NGROUPS_UMAX 1024
133 143 #define NGROUPS_OLDMAX 32
134 144
135 145 /*
136 146 * NGROUPS_MAX_DEFAULT: *MUST* match NGROUPS_MAX value in limits.h.
137 147 */
138 148 #define NGROUPS_MAX_DEFAULT 16
139 149
140 150 /*
141 151 * Default process priority. Keep it in sync with limits.h.
142 152 */
143 153 #define NZERO 20
144 154
145 155 /*
146 156 * Fundamental constants of the implementation--cannot be changed easily.
147 157 */
148 158
149 159 #define NBPW sizeof (int) /* number of bytes in an integer */
150 160
151 161 #define CMASK 022 /* default mask for file creation */
152 162 #define CDLIMIT (1L<<11) /* default max write address */
153 163 #define NBPS 0x20000 /* Number of bytes per segment */
154 164 #define NBPSCTR 512 /* Bytes per disk sector. */
155 165 #define UBSIZE 512 /* unix block size. */
156 166 #define SCTRSHFT 9 /* Shift for BPSECT. */
157 167
158 168 #ifdef _LITTLE_ENDIAN
159 169 #define lobyte(X) (((unsigned char *)&(X))[0])
160 170 #define hibyte(X) (((unsigned char *)&(X))[1])
161 171 #define loword(X) (((ushort_t *)&(X))[0])
162 172 #define hiword(X) (((ushort_t *)&(X))[1])
163 173 #endif
164 174 #ifdef _BIG_ENDIAN
165 175 #define lobyte(X) (((unsigned char *)&(X))[1])
166 176 #define hibyte(X) (((unsigned char *)&(X))[0])
167 177 #define loword(X) (((ushort_t *)&(X))[1])
168 178 #define hiword(X) (((ushort_t *)&(X))[0])
169 179 #endif
170 180
171 181 /* REMOTE -- whether machine is primary, secondary, or regular */
172 182 #define SYSNAME 9 /* # chars in system name */
173 183 #define PREMOTE 39
174 184
175 185 /*
176 186 * MAXPATHLEN defines the longest permissible path length,
177 187 * including the terminating null, after expanding symbolic links.
178 188 * TYPICALMAXPATHLEN is used in a few places as an optimization
179 189 * with a local buffer on the stack to avoid kmem_alloc().
180 190 * MAXSYMLINKS defines the maximum number of symbolic links
181 191 * that may be expanded in a path name. It should be set high
182 192 * enough to allow all legitimate uses, but halt infinite loops
183 193 * reasonably quickly.
184 194 * MAXNAMELEN is the length (including the terminating null) of
185 195 * the longest permissible file (component) name.
186 196 */
187 197 #define MAXPATHLEN 1024
188 198 #define TYPICALMAXPATHLEN 64
189 199 #define MAXSYMLINKS 20
190 200 #define MAXNAMELEN 256
191 201
192 202 /*
193 203 * MAXLINKNAMELEN defines the longest possible permitted datalink name,
194 204 * including the terminating NUL. Note that this must not be larger
195 205 * than related networking constants such as LIFNAMSIZ.
196 206 */
197 207 #define MAXLINKNAMELEN 32
198 208
199 209 #ifndef NADDR
200 210 #define NADDR 13
201 211 #endif
202 212
203 213 /*
204 214 * The following are defined to be the same as
205 215 * defined in /usr/include/limits.h. They are
206 216 * needed for pipe and FIFO compatibility.
207 217 */
208 218 #ifndef PIPE_BUF /* max # bytes atomic in write to a pipe */
209 219 #define PIPE_BUF 5120
210 220 #endif /* PIPE_BUF */
211 221
212 222 #ifndef PIPE_MAX /* max # bytes written to a pipe in a write */
213 223 #define PIPE_MAX 5120
214 224 #endif /* PIPE_MAX */
215 225
216 226 #ifndef NBBY
217 227 #define NBBY 8 /* number of bits per byte */
218 228 #endif
219 229
220 230 /* macros replacing interleaving functions */
221 231 #define dkblock(bp) ((bp)->b_blkno)
222 232 #define dkunit(bp) (minor((bp)->b_dev) >> 3)
223 233
224 234 /*
225 235 * File system parameters and macros.
226 236 *
227 237 * The file system is made out of blocks of at most MAXBSIZE units,
228 238 * with smaller units (fragments) only in the last direct block.
229 239 * MAXBSIZE primarily determines the size of buffers in the buffer
230 240 * pool. It may be made larger without any effect on existing
231 241 * file systems; however making it smaller make make some file
232 242 * systems unmountable.
233 243 *
234 244 * Note that the blocked devices are assumed to have DEV_BSIZE
235 245 * "sectors" and that fragments must be some multiple of this size.
236 246 */
237 247 #define MAXBSIZE 8192
238 248 #define DEV_BSIZE 512
239 249 #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
240 250 #define MAXFRAG 8
241 251 #ifdef _SYSCALL32
242 252 #define MAXOFF32_T 0x7fffffff
243 253 #endif
244 254 #ifdef _LP64
245 255 #define MAXOFF_T 0x7fffffffffffffffl
246 256 #define MAXOFFSET_T 0x7fffffffffffffffl
247 257 #else
248 258 #define MAXOFF_T 0x7fffffffl
249 259 #ifdef _LONGLONG_TYPE
250 260 #define MAXOFFSET_T 0x7fffffffffffffffLL
251 261 #else
252 262 #define MAXOFFSET_T 0x7fffffff
253 263 #endif
254 264 #endif /* _LP64 */
255 265
256 266 #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
257 267 ((unsigned long)(bytes) >> DEV_BSHIFT)
258 268 #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
259 269 ((unsigned long)(db) << DEV_BSHIFT)
260 270
261 271 /* 64 bit versions of btodb and dbtob */
262 272 #define lbtodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
263 273 ((u_offset_t)(bytes) >> DEV_BSHIFT)
264 274 #define ldbtob(db) /* calculates (db * DEV_BSIZE) */ \
265 275 ((u_offset_t)(db) << DEV_BSHIFT)
266 276
267 277 #ifndef _ASM /* Avoid typedef headaches for assembly files */
268 278 #ifndef NODEV
269 279 #define NODEV (dev_t)(-1l)
270 280 #ifdef _SYSCALL32
271 281 #define NODEV32 (dev32_t)(-1)
272 282 #endif /* _SYSCALL32 */
273 283 #endif /* NODEV */
274 284 #endif /* _ASM */
275 285
276 286 /*
277 287 * Size of arg list passed in by user.
278 288 */
279 289 #define NCARGS32 0x100000
280 290 #define NCARGS64 0x200000
281 291 #ifdef _LP64
282 292 #define NCARGS NCARGS64
283 293 #else /* _LP64 */
284 294 #define NCARGS NCARGS32
285 295 #endif /* _LP64 */
286 296
287 297 /*
288 298 * Scale factor for scaled integers used to count
289 299 * %cpu time and load averages.
290 300 */
291 301 #define FSHIFT 8 /* bits to right of fixed binary point */
292 302 #define FSCALE (1<<FSHIFT)
293 303
294 304 /*
295 305 * Delay units are in microseconds.
296 306 *
297 307 * XXX These macros are not part of the DDI!
298 308 */
299 309 #if defined(_KERNEL) && !defined(_ASM)
300 310 extern void drv_usecwait(clock_t);
301 311 #define DELAY(n) drv_usecwait(n)
302 312 #define CDELAY(c, n) \
303 313 { \
304 314 register int N = n; \
305 315 while (--N > 0) { \
306 316 if (c) \
307 317 break; \
308 318 drv_usecwait(1); \
309 319 } \
310 320 }
311 321 #endif /* defined(_KERNEL) && !defined(_ASM) */
312 322
313 323 #ifdef __cplusplus
314 324 }
315 325 #endif
316 326
317 327 /*
318 328 * The following is to free utilities from machine dependencies within
319 329 * an architecture. Must be included after definition of DEV_BSIZE.
320 330 */
321 331
322 332 #if (defined(_KERNEL) || defined(_KMEMUSER))
323 333
324 334 #if defined(_MACHDEP)
325 335 #include <sys/machparam.h>
326 336 #endif
327 337
328 338 #ifdef __cplusplus
329 339 extern "C" {
330 340 #endif
331 341
332 342 #if defined(_KERNEL) && !defined(_ASM)
333 343 extern int cpu_decay_factor;
334 344 extern pid_t maxpid;
335 345 extern pid_t jump_pid;
336 346
337 347 extern uintptr_t _kernelbase;
338 348 extern uintptr_t _userlimit;
339 349 extern uintptr_t _userlimit32;
340 350 #endif /* defined(_KERNEL) && !defined(_ASM) */
341 351
342 352 /*
343 353 * These three variables have been added within the #if defined(lint)
344 354 * below to ensure visibility to lint. This is a short term workaround
345 355 * to handle poor interaction between SS12 lint and these variables.
346 356 * CR 6742611 has been logged to address these issues.
347 357 */
348 358 #if defined(lint)
349 359 extern int snooping;
350 360 extern uint_t snoop_interval;
351 361 extern const unsigned int _pageshift;
352 362 #endif /* lint */
353 363
354 364 #if !defined(_MACHDEP)
355 365
356 366 /*
357 367 * Implementation architecture independent sections of the kernel use
358 368 * this section.
359 369 */
360 370 #if defined(_KERNEL) && !defined(_ASM)
361 371 extern int hz;
362 372 extern int snooping;
363 373 extern uint_t snoop_interval;
364 374 extern const unsigned long _pagesize;
365 375 extern const unsigned int _pageshift;
366 376 extern const unsigned long _pageoffset;
367 377 extern const unsigned long long _pagemask;
368 378 extern const unsigned long _mmu_pagesize;
369 379 extern const unsigned int _mmu_pageshift;
370 380 extern const unsigned long _mmu_pageoffset;
371 381 extern const unsigned long _mmu_pagemask;
372 382 extern const uintptr_t _argsbase;
373 383 extern const unsigned long _defaultstksz;
374 384 extern const unsigned int _nbpg;
375 385 extern const int _ncpu;
376 386 extern const int _ncpu_log2;
377 387 extern const int _ncpu_p2;
378 388 extern const int _clsize;
379 389 #endif /* defined(_KERNEL) && !defined(_ASM) */
380 390
381 391 /* Any additions to these #defines must be reflected in mdb_param.h+mdb_ks.c */
382 392 #define PAGESIZE _pagesize
383 393 #define PAGESHIFT _pageshift
384 394 #define PAGEOFFSET _pageoffset
385 395 #define PAGEMASK _pagemask
386 396 #define MMU_PAGESIZE _mmu_pagesize
387 397 #define MMU_PAGESHIFT _mmu_pageshift
388 398 #define MMU_PAGEOFFSET _mmu_pageoffset
389 399 #define MMU_PAGEMASK _mmu_pagemask
390 400
391 401 #define KERNELBASE _kernelbase
392 402 #define USERLIMIT _userlimit
393 403 #define USERLIMIT32 _userlimit32
394 404 #define ARGSBASE _argsbase
395 405 #define DEFAULTSTKSZ _defaultstksz
396 406 #define NCPU _ncpu
397 407 #define NCPU_LOG2 _ncpu_log2
398 408 #define NCPU_P2 _ncpu_p2
399 409
400 410 #endif /* defined(_MACHDEP) */
401 411
402 412 /*
403 413 * Some random macros for units conversion.
404 414 *
405 415 * These are machine independent but contain constants (*PAGESHIFT) which
406 416 * are only defined in the machine dependent file.
407 417 */
408 418
409 419 /*
410 420 * MMU pages to bytes, and back (with and without rounding)
411 421 */
412 422 #define mmu_ptob(x) ((x) << MMU_PAGESHIFT)
413 423 #define mmu_btop(x) (((x)) >> MMU_PAGESHIFT)
414 424 #define mmu_btopr(x) ((((x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))
415 425
416 426 /*
417 427 * 2 versions of pages to disk blocks
418 428 */
419 429 #define mmu_ptod(x) ((x) << (MMU_PAGESHIFT - DEV_BSHIFT))
420 430 #define ptod(x) ((x) << (PAGESHIFT - DEV_BSHIFT))
421 431
422 432 /*
423 433 * pages to bytes, and back (with and without rounding)
424 434 * Large Files: The explicit cast of x to unsigned int is deliberately
425 435 * removed as part of large files work. We pass longlong values to
426 436 * theses macros.
427 437 *
428 438 * Cast the input to ptob() to be a page count. This enforces 64-bit
429 439 * math on 64-bit kernels. For 32-bit kernels, callers must explicitly
430 440 * cast the input to be a 64-bit type if values greater than 4GB/PAGESIZE
431 441 * are possible.
432 442 */
433 443
434 444 #ifdef _LP64
435 445 #define ptob(x) (((pgcnt_t)(x)) << PAGESHIFT)
436 446 #else
437 447 #define ptob(x) ((x) << PAGESHIFT)
438 448 #endif /* _LP64 */
439 449 #define btop(x) (((x) >> PAGESHIFT))
440 450 #define btopr(x) ((((x) + PAGEOFFSET) >> PAGESHIFT))
441 451
442 452 /*
443 453 * disk blocks to pages, rounded and truncated
444 454 */
445 455 #define NDPP (PAGESIZE/DEV_BSIZE) /* # of disk blocks per page */
446 456 #define dtop(DD) (((DD) + NDPP - 1) >> (PAGESHIFT - DEV_BSHIFT))
447 457 #define dtopt(DD) ((DD) >> (PAGESHIFT - DEV_BSHIFT))
448 458
449 459 /*
450 460 * kB to pages and back
451 461 */
452 462 #define kbtop(x) ((x) >> (PAGESHIFT - 10))
453 463 #define ptokb(x) ((x) << (PAGESHIFT - 10))
454 464
455 465 /*
456 466 * POSIX.4 related configuration parameters
457 467 */
458 468 #define _AIO_LISTIO_MAX (4096)
459 469 #define _AIO_MAX (-1)
460 470 #define _MQ_OPEN_MAX (-1)
461 471 #define _MQ_PRIO_MAX (32)
462 472 #define _SEM_NSEMS_MAX INT_MAX
463 473 #define _SEM_VALUE_MAX INT_MAX
464 474
465 475 #ifdef __cplusplus
466 476 }
467 477 #endif
468 478
469 479 #else /* (defined(_KERNEL) || defined(_KMEMUSER)) */
470 480
471 481 /*
472 482 * The following are assorted machine dependent values which can be
473 483 * obtained in a machine independent manner through sysconf(2) or
474 484 * sysinfo(2). In order to guarantee that these provide the expected
475 485 * value at all times, the System Private interface (leading underscore)
476 486 * is used.
477 487 */
478 488
479 489 #include <sys/unistd.h>
480 490
481 491 #ifdef __cplusplus
482 492 extern "C" {
483 493 #endif
484 494
485 495 #if !defined(_ASM)
486 496 extern long _sysconf(int); /* System Private interface to sysconf() */
487 497 #endif /* !defined(_ASM) */
488 498
489 499 #define HZ ((clock_t)_sysconf(_SC_CLK_TCK))
490 500 #define TICK (1000000000/((clock_t)_sysconf(_SC_CLK_TCK)))
491 501 #define PAGESIZE (_sysconf(_SC_PAGESIZE))
492 502 #define PAGEOFFSET (PAGESIZE - 1)
493 503 #define PAGEMASK (~PAGEOFFSET)
494 504 #define MAXPID ((pid_t)_sysconf(_SC_MAXPID))
495 505 #define MAXEPHUID ((uid_t)_sysconf(_SC_EPHID_MAX))
496 506
497 507 #ifdef __cplusplus
498 508 }
499 509 #endif
500 510
501 511 #endif /* (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP) */
502 512
503 513 #endif /* _SYS_PARAM_H */
↓ open down ↓ |
372 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX