1: /* 2: * Copyright (c) 1986 Regents of the University of California. 3: * All rights reserved. The Berkeley software License Agreement 4: * specifies the terms and conditions for redistribution. 5: * 6: * @(#)param.h 1.6 (2.11BSD) 1999/9/5 7: */ 8: 9: #define BSD 211 /* 2.11 * 10, as cpp doesn't do floats */ 10: 11: #include <sys/localopts.h> 12: #include <sys/stddef.h> /* for 'offsetof' */ 13: 14: /* 15: * Machine type dependent parameters. 16: */ 17: #include <machine/machparam.h> 18: 19: /* 20: * Machine-independent constants 21: */ 22: #define NMOUNT 6 /* number of mountable file systems */ 23: #define MAXUPRC 20 /* max processes per user */ 24: #define NOFILE 30 /* max open files per process */ 25: #define CANBSIZ 256 /* max size of typewriter line */ 26: #define NCARGS 5120 /* # characters in exec arglist */ 27: #define NGROUPS 16 /* max number groups */ 28: 29: #define NOGROUP 65535 /* marker for empty group set member */ 30: 31: /* 32: * Priorities 33: */ 34: #define PSWP 0 35: #define PINOD 10 36: #define PRIBIO 20 37: #define PRIUBA 24 38: #define PZERO 25 39: #define PPIPE 26 40: #define PSOCK 26 41: #define PWAIT 30 42: #define PLOCK 35 43: #define PPAUSE 40 44: #define PUSER 50 45: 46: #define NZERO 0 47: 48: #define PRIMASK 0xff 49: #define PCATCH 0x100 50: 51: /* 52: * Signals 53: */ 54: #include <signal.h> 55: 56: #define NBPW sizeof(int) /* number of bytes in an integer */ 57: 58: #ifndef NULL 59: #define NULL 0 60: #endif 61: #define CMASK 026 /* default mask for file creation */ 62: #define NODEV (dev_t)(-1) 63: 64: #define CLBYTES (CLSIZE*NBPG) 65: #define CLOFSET (CLBYTES-1) 66: #define claligned(x) ((((int)(x))&CLOFSET)==0) 67: #define CLOFF CLOFSET 68: #define CLSHIFT (PGSHIFT + CLSIZELOG2) 69: 70: /* round a number of clicks up to a whole cluster */ 71: #define clrnd(i) (((i) + (CLSIZE-1)) &~ ((long)(CLSIZE-1))) 72: 73: /* CBLOCK is the size of a clist block, must be power of 2 */ 74: #define CBLOCK 32 75: #define CBSIZE (CBLOCK - sizeof(struct cblock *)) /* data chars/clist */ 76: #define CROUND (CBLOCK - 1) /* clist rounding */ 77: 78: #include <sys/types.h> 79: 80: /* 81: * File system parameters and macros. 82: * 83: * The file system is made out of blocks of most MAXBSIZE units. 84: */ 85: #define MAXBSIZE 1024 86: 87: /* 88: * MAXPATHLEN defines the longest permissable path length 89: * after expanding symbolic links. It is used to allocate 90: * a temporary buffer from the buffer pool in which to do the 91: * name expansion, hence should be a power of two, and must 92: * be less than or equal to MAXBSIZE. 93: * MAXSYMLINKS defines the maximum number of symbolic links 94: * that may be expanded in a path name. It should be set high 95: * enough to allow all legitimate uses, but halt infinite loops 96: * reasonably quickly. 97: */ 98: #define MAXPATHLEN 256 99: #define MAXSYMLINKS 8 100: 101: /* 102: * Macros for fast min/max. 103: */ 104: #define MIN(a,b) (((a)<(b))?(a):(b)) 105: #define MAX(a,b) (((a)>(b))?(a):(b)) 106: 107: /* 108: * Macros for counting and rounding. 109: */ 110: #ifndef howmany 111: #define howmany(x, y) (((x)+((y)-1))/(y)) 112: #endif 113: #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) 114: 115: /* 116: * Maximum size of hostname recognized and stored in the kernel. 117: */ 118: #define MAXHOSTNAMELEN 64 119: 120: #if defined(KERNEL) && defined(INET) 121: #include "../machine/net_mac.h" 122: #endif 123: 124: /* 125: * MAXMEM is the maximum core per process is allowed. First number is Kb. 126: */ 127: #define MAXMEM (300*16) 128: 129: /* 130: * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>) 131: */ 132: #define MAXLOGNAME 16 /* max login name length */