Annotation of 40BSD/cmd/berknet/mach.h, revision 1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.