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