1 /* @(#)mach.h 4.5 (Berkeley) 10/05/82 */ 2 3 /* sccs id variable */ 4 static char *mach_h_sid = "@(#)mach.h 1.11"; 5 6 /* 7 8 mach.h -- define machine-dependent things 9 10 *** Pre-processor Flags *** 11 12 This set of code is controlled by this set of conditional 13 compilation flags: 14 15 TESTING if defined, do not generate tests, etc. which require 16 super-user status. 17 18 OLDTTY if defined, compile for old 1 character TTY names 19 CCTTY if defined, compile for CC tty name format 20 if neither is defined, use v7 ttyname format 21 22 PASSWDF compile in code to handle /etc/passwdf - split passwd files 23 24 V6 Assume the v6 features instead of the v7 ones. 25 26 FUID use the funny uid's present on CC V6 27 28 DELIVERM Uses the delivermail program 29 30 HPASSWD The local machine has the hashed password stuff 31 32 OLDMAIL mail is in home-directory/.mail 33 USRMAIL mail is in /usr/mail/name 34 (mail is in /usr/spool/mail/name) 35 36 CC Machine is a Computer Center machine 37 NUID userid (as returned by getuid()) on this machine 38 UID1CHAR Uses vanila Version6 userid's (only 1 byte for uid) 39 NOEUID Does not have the geteuid() system call 40 NFREECMD doesn't allow any "network" free commands 41 NOFP floating point just doesn't work on this machine 42 NOREMACCT allows netlpr's on remote machines without an account 43 CSH use the /bin/csh shell (Paths.h sets BINSH to this path ). 44 CRN CC crn's are passed 45 DONTHOLDBIG large (size > MAXDAYFILE ) jobs wont be held until night for 46 transmission 47 48 SWAB this machine has byte-ordering reversed from the DEC VAX 49 and PDP-11 standard (the only current example is Onyx) 50 The conditonal flags are first defined 51 in "local.h" in this directory. 52 53 For "normal" version 6 machines, there is a dummy machine 54 definition for "VANILLA6" which indicates the v6 UNIX options. 55 56 For "normal" version 7 machines, there is a dummy machine 57 definition for "VANILLA7" which indicates the v7 UNIX options. 58 (VM/UNIX and Berkeley VM/VAX/UNIX can use this) 59 */ 60 /* be sure to include <stdio.h> before these defns */ 61 62 # include "local.h" 63 # include <sysexits.h> 64 65 /* note NUID is only used in mmail.c */ 66 67 # ifdef RAND 68 /* definitions for Rand-Unix */ 69 # ifdef VAX 70 # define LOCAL 'v' 71 # define NUID (-1) 72 # endif VAX 73 74 # ifdef GRAPHICS 75 # define V6 76 # define OLDTTY 77 # define UID1CHAR 78 # define OLDMAIL 79 # define LOCAL 'g' 80 # define NUID (-1) 81 # endif GRAPHICS 82 83 # ifdef TP 84 # define LOCAL 't' 85 # define V6 86 # define OLDTTY 87 # define UID1CHAR 88 # define OLDMAIL 89 # define NUID (-1) 90 # endif TP 91 92 /* end of definitions for Rand */ 93 # endif RAND 94 95 96 # ifdef NOSC 97 /* definitions for Naval Ocean Systems Center NOSC */ 98 # ifdef ATTS 99 # define LOCAL 'a' 100 # define V6 101 # define OLDTTY 102 # define UID1CHAR 103 # define OLDMAIL 104 # define NUID (-1) 105 # endif ATTS 106 107 # ifdef CCMM 108 # define LOCAL 'c' 109 # define V6 110 # define OLDTTY 111 # define UID1CHAR 112 # define OLDMAIL 113 # define NUID (-1) 114 # endif CCMM 115 116 # ifdef MSSF 117 # define V6 118 # define OLDTTY 119 # define UID1CHAR 120 # define OLDMAIL 121 # define LOCAL 'm' 122 # define NUID (-1) 123 # endif MSSF 124 125 /* end of definitions for NOSC */ 126 127 # endif NOSC 128 129 # ifdef BERKELEY 130 /* CFO - A */ 131 # ifdef A 132 # define CCV7 133 # define LOCAL 'a' 134 # endif A 135 136 /* CFO - B */ 137 # ifdef B 138 # define CCV7 139 # define LOCAL 'b' 140 # endif B 141 142 /* CFO - C */ 143 # ifdef C 144 # define CCV7 145 # define LOCAL 'c' 146 # endif C 147 148 /* CFO - D */ 149 # ifdef D 150 # define CCV7 151 # define LOCAL 'd' 152 # endif D 153 154 /* CFO - E */ 155 # ifdef E 156 # define CCV7 157 # define LOCAL 'e' 158 # endif E 159 160 /* CFO - F */ 161 # ifdef F 162 # define CCV7 163 # define LOCAL 'f' 164 # endif F 165 166 /* CFO - G */ 167 # ifdef G 168 # define LOCAL 'g' 169 # define NUID (501) 170 # endif G 171 172 /* CFO - Jade */ 173 # ifdef H 174 # define LOCAL 'h' 175 # define NUID (501) 176 # endif H 177 178 /* CSSG - ucberl70 */ 179 # ifdef ERL70 180 # define LOCAL 'i' 181 # define NUID (174) 182 # endif ERL70 183 184 /* Ingres Group - ucbingres */ 185 # ifdef INGVAX 186 # define LOCAL 'j' 187 # define NUID (37) 188 # define FREELPR 189 # define DELIVERM 190 # endif INGVAX 191 192 /* CS network hub - ucbvax */ 193 # ifdef UCBVAX 194 # define LOCAL 'k' 195 # define NUID (35) 196 # define DELIVERM 197 # define MAXSENDQ 35 198 # endif UCBVAX 199 200 /* Brodersen - ucboz */ 201 # ifdef OZ 202 # define LOCAL 'l' 203 # define NUID (501) 204 # endif OZ 205 206 /* EE-Signal Proccessing - ucbmedea */ 207 # ifdef MEDEA 208 # define LOCAL 'm' 209 # define NUID (501) 210 # endif MEDEA 211 212 /* Fateman - ucbkim */ 213 # ifdef KIM 214 # define LOCAL 'n' 215 # define DELIVERM 216 # define NUID (501) 217 # endif KIM 218 219 /* EECS-Research - ucbesvax */ 220 # ifdef ESVAX 221 # define LOCAL 'o' 222 # define NUID (67) 223 # endif ESVAX 224 225 /* Newton CAD - ucbcad */ 226 # ifdef CAD 227 # define LOCAL 'p' 228 # define NUID (67) 229 # endif CAD 230 231 /* currently unused */ 232 # ifdef Q 233 # define LOCAL 'q' 234 # endif Q 235 236 /* Fabry CSRG - ucbarpa */ 237 # ifdef ARPAVAX 238 # define LOCAL 'r' 239 # define NUID (501) 240 # define DELIVERM 241 # define MAXSENDQ 35 242 # endif ARPAVAX 243 244 /* CFO & SRC - SRC */ 245 # ifdef SRC 246 # define LOCAL 's' 247 # define NUID 38 248 # endif SRC 249 250 /* Math/Stat Dept - MathStat */ 251 # ifdef MATHSTAT 252 # define LOCAL 't' 253 # define NUID (-1) 254 # endif MATHSTAT 255 256 /* Fabry CSRG - c70 */ 257 # ifdef C70 258 # define LOCAL 'u' 259 # define NUID (501) 260 # define DELIVERM 261 # define MAXSENDQ 35 262 # endif C70 263 264 /* CS Research - ucbernie */ 265 # ifdef CSVAX 266 # define LOCAL 'v' 267 # define NUID (501) 268 # define DELIVERM 269 # define MAXSENDQ 35 270 # endif CSVAX 271 272 /* Stat Dept - statvax */ 273 # ifdef STATVAX 274 # define LOCAL 'w' 275 # define NUID 276 # endif STATVAX 277 278 /* CS Research - Onyx */ 279 # ifdef ONYX 280 # define LOCAL 'x' 281 # define NUID (10) 282 # define NOFP 283 # define SWAB 284 # undef PARMLIST 285 # define PARMLIST 20 286 # define DELIVERM 287 # endif ONYX 288 289 /* EECS Dept - Cory */ 290 # ifdef CORY 291 # define LOCAL 'y' 292 # define NUID (10) 293 # define MAXSENDQ 35 294 # include <signal.h> 295 # undef NETLDISC 296 # define DELIVERM 297 # endif CORY 298 299 /* EECS Dept Administrative - ucbear */ 300 # ifdef EARVAX 301 # define LOCAL 'z' 302 # define NUID ((1 << 8) | 104) 303 # define DELIVERM 304 # endif EARVAX 305 306 /* end of Berkeley definitions */ 307 # endif BERKELEY 308 309 /* 310 the CC V6 machines are all the same. 311 splitting their type into a separate group will 312 allow the binary patching program "patchd" to be 313 used to patch the binaries so the sources can be compiled 314 on one CC machine and the binaries shipped around 315 to the other CC machines. 316 */ 317 # ifdef CCV7 318 # undef CC 319 # define NOREMACCT 320 # define NUID (10) 321 # define MAXSENDQ 35 322 # define CSH 323 # define CRN 324 # define MAGICCRN "3700" /* default CC crn */ 325 # endif CCV7 326 327 # ifdef CC 328 # define V6 329 # define CCV6 330 # define CCTTY 331 # define PASSWDF 332 # define FUID 333 # define USRMAIL 334 # define NUID (115) 335 # define MAXSENDQ 35 336 # define NOREMACCT 337 # define CSH 338 # define CRN 339 # define MAGICCRN "3700" /* default CC crn */ 340 # endif CC 341 342 /* default version 6 options */ 343 # ifdef VANILLA6 344 # define V6 345 # define UID1CHAR 346 # define OLDTTY 347 # define OLDMAIL 348 # endif VANILLA6 349 350 /* default version 7 options */ 351 # ifdef VANILLA7 352 # endif VANILLA7 353 354 # ifndef V6 355 # include <sys/param.h> 356 # include <sys/stat.h> 357 # include <dir.h> 358 # include <sys/times.h> 359 # include <ctype.h> 360 # include <sgtty.h> 361 # include <errno.h> 362 # include <pwd.h> 363 # include <assert.h> 364 # include <setjmp.h> 365 # define getsize(S) ((S)->st_size) 366 # define gettime() (time(0)) 367 int (*signal())(); 368 /* 369 #define SIG_DFL (int (*)())0 370 #define SIG_IGN (int (*)())1 371 */ 372 373 # else V6 374 375 # define ETXTBSY 26 376 # define S_IREAD 0400 377 # define S_IFMT 060000 378 # define S_IFDIR 0040000 379 # define ANYP 0300 380 # define ECHO 010 381 # define ROOTINO 1 382 # define TIOCEXCL 0 383 # define SIGHUP 1 384 # define SIGINT 2 385 # define SIGQUIT 3 386 # define SIGKILL 9 387 # define SIGALRM 14 388 # define SIGTERM 15 389 # define SIG_IGN 1 390 # define ASSERT "Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}} 391 # define assert(ex) {if (!(ex)){fprintf(stderr,ASSERT 392 # define isprint(c) (040 <= c && c <= 0176) 393 # define longjmp(a,b) reset() 394 # define setjmp(a) setexit() 395 396 397 struct tms { /* see times - sect 2 */ 398 int tms_utime; /* user time */ 399 int tms_stime; /* system time */ 400 long tms_cutime; /* user time, children */ 401 long tms_cstime; /* system time, children */ 402 }; 403 struct sgttyb { 404 char sg_ispeed; 405 char sg_ospeed; 406 char sg_erase; 407 char sg_kill; 408 int sg_flags; 409 }; 410 struct passwd { /* see getpwent(3) */ 411 char *pw_name; 412 char *pw_passwd; 413 int pw_uid; 414 int pw_gid; 415 int pw_quota; 416 char *pw_comment; 417 char *pw_gecos; 418 char *pw_dir; 419 char *pw_shell; 420 }; 421 /* /usr/include/varargs.h */ 422 typedef char *va_list; 423 # define va_dcl int va_alist; 424 # define va_start(list) list = (char *) &va_alist 425 # define va_end(list) 426 # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] 427 428 typedef int jmp_buf[10]; 429 long gettime(), getsize(); 430 # endif V6 431 /* end of non-v7 defns */ 432 433 # ifdef FUID 434 # define getgid(s) (0) 435 # endif FUID 436 437 # ifdef UID1CHAR 438 # define uidmask(S) (S & 0377) 439 # define geteuid() ((getuid()>>8)&0377) 440 # else UID1CHAR 441 # define uidmask(S) (S) 442 # endif UID1CHAR 443 444 # ifdef NOEUID 445 # define geteuid(S) (-1) 446 # endif NOEUID 447 448 # ifdef CCTTY 449 # define ttyname(S) myttyname(S) 450 # endif CCTTY 451 452 #ifdef CRN 453 #include <gecos.h> 454 #endif CRN 455 456 # ifdef OLDTTY 457 /* this is the version 7 utmp structure. the getutmp() procedure 458 converts the v6 structure into this format 459 */ 460 struct utmp { 461 char ut_line[8]; /* tty name */ 462 char ut_name[8]; /* user id */ 463 long ut_time; /* time on */ 464 }; 465 # else OLDTTY 466 # include <utmp.h> 467 # endif OLDTTY 468 469 # define chfromf(S) (S ? 'T' : 'F') 470 471 /* functions */ 472 473 char *hgethome(), *calloc(), *ctime(), *getenv(); 474 char *getname(), *getun(), *getlogin(); 475 char *SnFromUid(), *ttyname(); 476 struct passwd *getpwnam(), *getpwuid(); 477 long atol(),time(); 478 struct utmp *getutmp(); 479