Annotation of 3BSD/cmd/net/mach.h, revision 1.1.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: NEWPROT                use the new protocol, instead of the default protocol
                     20: 
                     21: V6             Assume the v6 features insted of the v7 ones.
                     22: 
                     23: FUID           use the funny uid's present on Cory and CC
                     24: ROPTION                The local machine mail program has the magic -r option
                     25: ROPTION2       The local machine mail program has the magic -r option
                     26: 
                     27: HPASSWD                The local machine has the hashed password stuff
                     28: 
                     29: SPACCT         under certain circumstances, allow remote login without acct
                     30: 
                     31: OLDMAIL                mail is in home-directory/.mail
                     32: USRMAIL                mail is in /usr/mail/name
                     33:                (mail is in /usr/spool/mail/name)
                     34: 
                     35: CC             Machine is a Computer Center machine
                     36: NUID           userid (as returned by getuid()) on this machine
                     37: UID1CHAR       Uses vanila Version6 userid's (only 1 byte for uid)
                     38: NOEUID         Does not have the geteuid() system call
                     39: 
                     40: 
                     41: The conditonal flags are first defined
                     42: in "/usr/include/whoami.h" on the local machine.
                     43: 
                     44: For "normal" version 6 machines, there is a dummy machine
                     45: definition for "VANILLA6" which indicates the v6 UNIX options.
                     46: 
                     47: For "normal" version 7 machines, there is a dummy machine
                     48: definition for "VANILLA7" which indicates the v7 UNIX options.
                     49: */
                     50: /* be sure to include <stdio.h> before these defns */
                     51: 
                     52: # include <whoami.h>
                     53: 
                     54: /* note NUID is only used in mmail.c */
                     55: 
                     56: # ifdef A
                     57: # define CC
                     58: # define LOCAL 'a'
                     59: # endif
                     60: 
                     61: # ifdef B
                     62: # define CC
                     63: # define LOCAL 'b'
                     64: # endif
                     65: 
                     66: # ifdef C
                     67: # define CC
                     68: # define LOCAL 'c'
                     69: # endif
                     70: 
                     71: # ifdef D
                     72: # define CC
                     73: # define LOCAL 'd'
                     74: # endif
                     75: 
                     76: # ifdef E
                     77: # define CC
                     78: # define LOCAL 'e'
                     79: # endif
                     80: 
                     81: # ifdef F
                     82: # define ROPTION2
                     83: # define LOCAL 'f'
                     84: # define NUID (501)
                     85: # define ISVAX
                     86: # endif
                     87: 
                     88: # ifdef ING70
                     89: # define V6
                     90: # define OLDTTY
                     91: # define UID1CHAR
                     92: # define PASSWDF
                     93: # define ROPTION2
                     94: # define MULTNAMS
                     95: # define FREELPR
                     96: # define LOCAL 'i'
                     97: # define NUID (174)
                     98: /* correct vers. 7 = LOCAL, NUID */
                     99: # endif
                    100: 
                    101: # ifdef INGVAX
                    102: # define LOCAL 'j'
                    103: # define NUID (37)
                    104: # define ROPTION2
                    105: # define ISVAX
                    106: # define FREELPR
                    107: # endif
                    108: 
                    109: # ifdef IMAGE
                    110: # define V6
                    111: # define OLDTTY
                    112: # define UID1CHAR
                    113: # define USRMAIL
                    114: # define LOCAL 'm'
                    115: # define NUID (-1)
                    116: /* correct vers. 7 = LOCAL, NUID */
                    117: # endif
                    118: 
                    119: # ifdef OPTVAX
                    120: # define LOCAL 'o'
                    121: # define NUID (-1)
                    122: # define ISVAX
                    123: # endif
                    124: 
                    125: # ifdef Q
                    126: # define V6
                    127: # define OLDTTY
                    128: # define FUID
                    129: # define NOEUID
                    130: # define LOCAL 'q'
                    131: # define NUID ((11 << 8) | 38)
                    132: /* correct vers. 7 = LOCAL, NUID */
                    133: # endif
                    134: 
                    135: # ifdef SRC
                    136: # define V6
                    137: # define OLDTTY
                    138: # define FUID
                    139: # define NOEUID
                    140: # define SPACCT
                    141: # define LOCAL 's'
                    142: # define NUID ((11 << 8) | 38)
                    143: /* correct vers. 7 = LOCAL, NUID */
                    144: # endif
                    145: 
                    146: # ifdef CSVAX
                    147: # define ROPTION
                    148: # define LOCAL 'v'
                    149: # define NUID (501)
                    150: # define ISVAX
                    151: # endif
                    152: 
                    153: # ifdef CORY
                    154: # define LOCAL 'y'
                    155: # define NUID (10)
                    156: # define ROPTION
                    157: # endif
                    158: 
                    159: # ifdef EECS40
                    160: # define V6
                    161: # define OLDTTY
                    162: # define USRMAIL
                    163: # define UID1CHAR
                    164: # define LOCAL 'z'
                    165: # define NUID (-1)
                    166: /* correct vers. 7 = LOCAL, NUID */
                    167: # endif
                    168: 
                    169: /*
                    170:        the CC V6 machines are all the same.
                    171:        splitting their type into a separate group will
                    172:        allow the binary patching program "patchd" to be
                    173:        used to patch the binaries so the sources can be compiled
                    174:        on one CC machine and the binaries shipped around
                    175:        to the other CC machines.
                    176: */
                    177: # ifdef CC
                    178: # define V6
                    179: # define CCTTY
                    180: # define PASSWDF
                    181: # define FUID
                    182: # define USRMAIL
                    183: # define SPACCT
                    184: # define NUID ((217 << 8) | 2)
                    185: /* correct vers. 7 = LOCAL, NUID, CC */
                    186: # endif
                    187: 
                    188: /* default version 6 options */
                    189: # ifdef VANILLA6
                    190: # define V6
                    191: # define UID1CHAR
                    192: # define OLDTTY
                    193: # endif
                    194: 
                    195: /* default version 7 options */
                    196: # ifdef VANILLA7
                    197: # endif
                    198: 
                    199: # ifndef V6
                    200: # include <sys/param.h>
                    201: # include <sys/stat.h>
                    202: # include <sys/dir.h>
                    203: # include <sys/times.h>
                    204: /* # include <signal.h> */
                    205: # include <ctype.h>
                    206: # include <sgtty.h>
                    207: # include <errno.h>
                    208: # include <pwd.h>
                    209: # include <assert.h>
                    210: # include <setjmp.h>
                    211: # define getsize(S)    ((S)->st_size)
                    212: # define gettime()     (time(0))
                    213: # define SIG_IGN       1
                    214: 
                    215: # else
                    216: 
                    217: # define ETXTBSY 26
                    218: # define S_IREAD 0400
                    219: # define S_IFMT 060000
                    220: # define S_IFDIR 0040000
                    221: # define ANYP 0300
                    222: # define ECHO 010
                    223: # define ROOTINO 1
                    224: # define DIRSIZ 14
                    225: # define TIOCEXCL 0
                    226: # define SIGHUP                1
                    227: # define SIGINT        2
                    228: # define SIGQUIT       3
                    229: # define SIGKIL                9
                    230: # define SIGCLK        14
                    231: # define SIGTRM        15
                    232: # define SIG_IGN       1
                    233: # define ASSERT "Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
                    234: # define assert(ex) {if (!(ex)){fprintf(stderr,ASSERT
                    235: # define isprint(c) (040 <= c && c <= 0176)
                    236: # define longjmp(a,b) reset()
                    237: # define setjmp(a) setexit()
                    238: 
                    239: struct stat {
                    240:        int st_dev;
                    241:        int st_ino;
                    242:        int st_mode;
                    243:        char st_nlink:8;
                    244:        char st_uid:8;
                    245:        char st_gid:8;
                    246:        char st_size0;
                    247:        int st_size1;
                    248:        int st_addr[8];
                    249:        long st_atime;
                    250:        long st_mtime;
                    251:        };
                    252: struct direct {
                    253:        int d_ino;
                    254:        char d_name[DIRSIZ];
                    255:        };
                    256: struct tms {                           /* see times - sect 2 */
                    257:        int     tms_utime;              /* user time */
                    258:        int     tms_stime;              /* system time */
                    259:        long    tms_cutime;             /* user time, children */
                    260:        long    tms_cstime;             /* system time, children */
                    261:        };
                    262: struct sgttyb {
                    263:        char sg_ispeed;
                    264:        char sg_ospeed;
                    265:        char sg_erase;
                    266:        char sg_kill;
                    267:        int sg_flags;
                    268:        };
                    269: struct passwd { /* see getpwent(3) */
                    270:        char    *pw_name;
                    271:        char    *pw_passwd;
                    272:        int     pw_uid;
                    273:        int     pw_gid;
                    274:        int     pw_quota;
                    275:        char    *pw_comment;
                    276:        char    *pw_gecos;
                    277:        char    *pw_dir;
                    278:        char    *pw_shell;
                    279:        };
                    280: typedef int jmp_buf[10];
                    281: long gettime(), getsize();
                    282: # endif
                    283: /* end of non-v7 defns */
                    284: 
                    285: # ifdef FUID
                    286: # define getgid(s) (0)
                    287: # endif
                    288: 
                    289: # ifdef UID1CHAR
                    290: # define uidmask(S) (S & 0377)
                    291: # define geteuid() ((getuid()>>8)&0377)
                    292: # else
                    293: # define uidmask(S) (S)
                    294: # endif
                    295: 
                    296: # ifdef NOEUID
                    297: # define geteuid(S) (-1)
                    298: # endif
                    299: 
                    300: # ifdef CCTTY
                    301: # define ttyname(S) myttyname(S)
                    302: # endif
                    303: 
                    304: # ifdef OLDTTY
                    305: struct utmp {
                    306:        char ut_name[8];
                    307:        char ut_tty;
                    308:        char ut_fill;
                    309:        long ut_time;
                    310:        int  ut_fill1;
                    311:        };
                    312: # else
                    313: # include <utmp.h>
                    314: # endif
                    315: 
                    316: /* functions */
                    317: 
                    318: char *hgethome(), *calloc(), *ctime(), *getenv();
                    319: char *getname(), *getun(), *getlogin();
                    320: struct passwd *getpwnam(), *getpwuid();
                    321: long fixuplong(),atol(),time();

unix.superglobalmegacorp.com

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