BSD 4_1_snap development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 15 Mar 1981 14:46:24 +0000 (06:46 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 15 Mar 1981 14:46:24 +0000 (06:46 -0800)
Work on file usr/include/a.out.h
Work on file usr/include/ar.h
Work on file usr/include/ctype.h
Work on file usr/include/assert.h
Work on file usr/include/dir.h
Work on file usr/include/core.h
Work on file usr/include/dbm.h
Work on file usr/include/dumprestor.h
Work on file usr/include/lastlog.h
Work on file usr/include/fstab.h
Work on file usr/include/grp.h
Work on file usr/include/errno.h
Work on file usr/include/frame.h
Work on file usr/include/mtab.h
Work on file usr/include/nlist.h
Work on file usr/include/pwd.h
Work on file usr/include/olddump.h
Work on file usr/include/ranlib.h
Work on file usr/include/mp.h
Work on file usr/include/pagsiz.h
Work on file usr/include/sccs.h
Work on file usr/include/sgtty.h
Work on file usr/include/setjmp.h
Work on file usr/include/saio.h
Work on file usr/include/time.h
Work on file usr/include/stab.h
Work on file usr/include/sysexits.h
Work on file usr/include/signal.h
Work on file usr/include/sys.s
Work on file usr/include/stat.h
Work on file usr/include/utmp.h
Work on file usr/include/wait.h
Work on file usr/include/whoami.h
Work on file usr/include/whoami
Work on file usr/include/valign.h
Work on file usr/include/vfont.h
Work on file usr/include/varargs.h

Synthesized-from: CSRG/cd1/4.1.snap

37 files changed:
usr/include/a.out.h [new file with mode: 0644]
usr/include/ar.h [new file with mode: 0644]
usr/include/assert.h [new file with mode: 0644]
usr/include/core.h [new file with mode: 0644]
usr/include/ctype.h [new file with mode: 0644]
usr/include/dbm.h [new file with mode: 0644]
usr/include/dir.h [new file with mode: 0644]
usr/include/dumprestor.h [new file with mode: 0644]
usr/include/errno.h [new file with mode: 0644]
usr/include/frame.h [new file with mode: 0644]
usr/include/fstab.h [new file with mode: 0644]
usr/include/grp.h [new file with mode: 0644]
usr/include/lastlog.h [new file with mode: 0644]
usr/include/mp.h [new file with mode: 0644]
usr/include/mtab.h [new file with mode: 0644]
usr/include/nlist.h [new file with mode: 0644]
usr/include/olddump.h [new file with mode: 0644]
usr/include/pagsiz.h [new file with mode: 0644]
usr/include/pwd.h [new file with mode: 0644]
usr/include/ranlib.h [new file with mode: 0644]
usr/include/saio.h [new file with mode: 0644]
usr/include/sccs.h [new file with mode: 0644]
usr/include/setjmp.h [new file with mode: 0644]
usr/include/sgtty.h [new file with mode: 0644]
usr/include/signal.h [new file with mode: 0644]
usr/include/stab.h [new file with mode: 0644]
usr/include/stat.h [new file with mode: 0644]
usr/include/sys.s [new file with mode: 0644]
usr/include/sysexits.h [new file with mode: 0644]
usr/include/time.h [new file with mode: 0644]
usr/include/utmp.h [new file with mode: 0644]
usr/include/valign.h [new file with mode: 0644]
usr/include/varargs.h [new file with mode: 0644]
usr/include/vfont.h [new file with mode: 0644]
usr/include/wait.h [new file with mode: 0644]
usr/include/whoami [new file with mode: 0644]
usr/include/whoami.h [new file with mode: 0644]

diff --git a/usr/include/a.out.h b/usr/include/a.out.h
new file mode 100644 (file)
index 0000000..3ea301a
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Header prepended to each a.out file.
+ */
+struct exec {
+       long    a_magic;        /* magic number */
+unsigned long  a_text;         /* size of text segment */
+unsigned long  a_data;         /* size of initialized data */
+unsigned long  a_bss;          /* size of uninitialized data */
+unsigned long  a_syms;         /* size of symbol table */
+unsigned long  a_entry;        /* entry point */
+unsigned long  a_trsize;       /* size of text relocation */
+unsigned long  a_drsize;       /* size of data relocation */
+};
+
+#define        OMAGIC  0407            /* old impure format */
+#define        NMAGIC  0410            /* read-only text */
+#define        ZMAGIC  0413            /* demand load format */
+
+/*
+ * Macros which take exec structures as arguments and tell whether
+ * the file has a reasonable magic number or offsets to text|symbols|strings.
+ */
+#define        N_BADMAG(x) \
+    (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
+
+#define        N_TXTOFF(x) \
+       ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec))
+#define N_SYMOFF(x) \
+       (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize)
+#define        N_STROFF(x) \
+       (N_SYMOFF(x) + (x).a_syms)
+
+/*
+ * Format of a relocation datum.
+ */
+struct relocation_info {
+       int     r_address;      /* address which is relocated */
+unsigned int   r_symbolnum:24, /* local symbol ordinal */
+               r_pcrel:1,      /* was relocated pc relative already */
+               r_length:2,     /* 0=byte, 1=word, 2=long */
+               r_extern:1,     /* does not include value of sym referenced */
+               :4;             /* nothing, yet */
+};
+
+/*
+ * Format of a symbol table entry; this file is included by <a.out.h>
+ * and should be used if you aren't interested the a.out header
+ * or relocation information.
+ */
+struct nlist {
+       union {
+               char    *n_name;        /* for use when in-core */
+               long    n_strx;         /* index into file string table */
+       } n_un;
+unsigned char  n_type;         /* type flag, i.e. N_TEXT etc; see below */
+       char    n_other;        /* unused */
+       short   n_desc;         /* see <stab.h> */
+unsigned long  n_value;        /* value of this symbol (or sdb offset) */
+};
+#define        n_hash  n_desc          /* used internally by ld */
+
+/*
+ * Simple values for n_type.
+ */
+#define        N_UNDF  0x0             /* undefined */
+#define        N_ABS   0x2             /* absolute */
+#define        N_TEXT  0x4             /* text */
+#define        N_DATA  0x6             /* data */
+#define        N_BSS   0x8             /* bss */
+#define        N_COMM  0x12            /* common (internal to ld) */
+#define        N_FN    0x1f            /* file name symbol */
+
+#define        N_EXT   01              /* external bit, or'ed in */
+#define        N_TYPE  0x1e            /* mask for all the type bits */
+
+/*
+ * Sdb entries have some of the N_STAB bits set.
+ * These are given in <stab.h>
+ */
+#define        N_STAB  0xe0            /* if any of these bits set, a SDB entry */
+
+/*
+ * Format for namelist values.
+ */
+#define        N_FORMAT        "%08x"
diff --git a/usr/include/ar.h b/usr/include/ar.h
new file mode 100644 (file)
index 0000000..8927bf0
--- /dev/null
@@ -0,0 +1,14 @@
+#define        ARMAG   "!<arch>\n"
+#define        SARMAG  8
+
+#define        ARFMAG  "`\n"
+
+struct ar_hdr {
+       char    ar_name[16];
+       char    ar_date[12];
+       char    ar_uid[6];
+       char    ar_gid[6];
+       char    ar_mode[8];
+       char    ar_size[10];
+       char    ar_fmag[2];
+};
diff --git a/usr/include/assert.h b/usr/include/assert.h
new file mode 100644 (file)
index 0000000..6c51adc
--- /dev/null
@@ -0,0 +1,7 @@
+# ifndef NDEBUG
+# define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
+# define assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
+# else
+# define _assert(ex) ;
+# define assert(ex) ;
+# endif
diff --git a/usr/include/core.h b/usr/include/core.h
new file mode 100644 (file)
index 0000000..3d66409
--- /dev/null
@@ -0,0 +1,4 @@
+/* machine dependent stuff for core files */
+#define TXTRNDSIZ 1024L
+#define stacktop(siz) (0x80000000L-6*0x200)
+#define stackbas(siz) (0x80000000L-6*0x200-siz)
diff --git a/usr/include/ctype.h b/usr/include/ctype.h
new file mode 100644 (file)
index 0000000..d314c05
--- /dev/null
@@ -0,0 +1,24 @@
+#define        _U      01
+#define        _L      02
+#define        _N      04
+#define        _S      010
+#define _P     020
+#define _C     040
+#define _X     0100
+
+extern char    _ctype_[];
+
+#define        isalpha(c)      ((_ctype_+1)[c]&(_U|_L))
+#define        isupper(c)      ((_ctype_+1)[c]&_U)
+#define        islower(c)      ((_ctype_+1)[c]&_L)
+#define        isdigit(c)      ((_ctype_+1)[c]&_N)
+#define        isxdigit(c)     ((_ctype_+1)[c]&(_N|_X))
+#define        isspace(c)      ((_ctype_+1)[c]&_S)
+#define ispunct(c)     ((_ctype_+1)[c]&_P)
+#define isalnum(c)     ((_ctype_+1)[c]&(_U|_L|_N))
+#define isprint(c)     ((_ctype_+1)[c]&(_P|_U|_L|_N))
+#define iscntrl(c)     ((_ctype_+1)[c]&_C)
+#define isascii(c)     ((unsigned)(c)<=0177)
+#define toupper(c)     ((c)-'a'+'A')
+#define tolower(c)     ((c)-'A'+'a')
+#define toascii(c)     ((c)&0177)
diff --git a/usr/include/dbm.h b/usr/include/dbm.h
new file mode 100644 (file)
index 0000000..c2af8bd
--- /dev/null
@@ -0,0 +1,31 @@
+#define        PBLKSIZ 1024
+#define        DBLKSIZ 4096
+#define        BYTESIZ 8
+#define        NULL    ((char *) 0)
+
+long   bitno;
+long   maxbno;
+long   blkno;
+long   hmask;
+
+char   pagbuf[PBLKSIZ];
+char   dirbuf[DBLKSIZ];
+
+int    dirf;
+int    pagf;
+int    dbrdonly;
+
+typedef        struct
+{
+       char    *dptr;
+       int     dsize;
+} datum;
+
+datum  fetch();
+datum  makdatum();
+datum  firstkey();
+datum  nextkey();
+datum  firsthash();
+long   calchash();
+long   hashinc();
+
diff --git a/usr/include/dir.h b/usr/include/dir.h
new file mode 100644 (file)
index 0000000..f714208
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef        DIRSIZ
+#define        DIRSIZ  14
+#endif
+struct dir
+{
+       ino_t   d_ino;
+       char    d_name[DIRSIZ];
+};
diff --git a/usr/include/dumprestor.h b/usr/include/dumprestor.h
new file mode 100644 (file)
index 0000000..f2a5722
--- /dev/null
@@ -0,0 +1,36 @@
+#define NTREC          10
+#define MLEN           16
+#define MSIZ           4096
+
+#define TS_TAPE        1
+#define TS_INODE       2
+#define TS_BITS        3
+#define TS_ADDR        4
+#define TS_END         5
+#define TS_CLRI        6
+#define MAGIC          (int)60011
+#define CHECKSUM       (int)84446
+
+struct spcl {
+       int     c_type;
+       time_t  c_date;
+       time_t  c_ddate;
+       int     c_volume;
+       daddr_t c_tapea;
+       ino_t   c_inumber;
+       int     c_magic;
+       int     c_checksum;
+       struct  dinode  c_dinode;
+       int     c_count;
+       char    c_addr[BSIZE];
+} spcl;
+
+struct idates {
+       char    id_name[16];
+       char    id_incno;
+       time_t  id_ddate;
+};
+
+#define        DUMPOUTFMT      "%-16s %c %s"           /* for printf */
+                                               /* name, incno, ctime(date) */
+#define        DUMPINFMT       "%16s %c %[^\n]\n"      /* inverse for scanf */
diff --git a/usr/include/errno.h b/usr/include/errno.h
new file mode 100644 (file)
index 0000000..3ff9fde
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Error codes
+ */
+
+#define        EPERM   1
+#define        ENOENT  2
+#define        ESRCH   3
+#define        EINTR   4
+#define        EIO     5
+#define        ENXIO   6
+#define        E2BIG   7
+#define        ENOEXEC 8
+#define        EBADF   9
+#define        ECHILD  10
+#define        EAGAIN  11
+#define        ENOMEM  12
+#define        EACCES  13
+#define        EFAULT  14
+#define        ENOTBLK 15
+#define        EBUSY   16
+#define        EEXIST  17
+#define        EXDEV   18
+#define        ENODEV  19
+#define        ENOTDIR 20
+#define        EISDIR  21
+#define        EINVAL  22
+#define        ENFILE  23
+#define        EMFILE  24
+#define        ENOTTY  25
+#define        ETXTBSY 26
+#define        EFBIG   27
+#define        ENOSPC  28
+#define        ESPIPE  29
+#define        EROFS   30
+#define        EMLINK  31
+#define        EPIPE   32
+
+/* math software */
+#define        EDOM    33
+#define        ERANGE  34
diff --git a/usr/include/frame.h b/usr/include/frame.h
new file mode 100644 (file)
index 0000000..ddc1d46
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Definition of the vax calls/callg frame.
+ */
+struct frame {
+       int     fr_handler;
+       u_int   fr_psw:16,              /* saved psw */
+               fr_mask:12,             /* register save mask */
+               :1,
+               fr_s:1,                 /* call was a calls, not callg */
+               fr_spa:2;               /* stack pointer alignment */
+       int     fr_savap;               /* saved arg pointer */
+       int     fr_savfp;               /* saved frame pointer */
+       int     fr_savpc;               /* saved program counter */
+};
diff --git a/usr/include/fstab.h b/usr/include/fstab.h
new file mode 100644 (file)
index 0000000..aa9b32f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * File system table, see fstab (5)
+ *
+ * Used by dump, mount, umount, swapon, fsck, df, ...
+ *
+ * The fs_spec field is the block special name.
+ * Programs that want to use the character special name must
+ * create that name by prepending a 'r' after the right most slash.
+ */
+
+#define        FSTAB           "/etc/fstab"
+#define        FSNMLG          16
+
+#define        FSTABFMT        "%16s:%16s:%2s:%d:%d\n"
+#define        FSTABARG(p)     (p)->fs_spec, (p)->fs_file, \
+                       (p)->fs_type, &(p)->fs_freq, &(p)->fs_passno
+#define FSTABNARGS     5
+
+#define        FSTAB_RW        "rw"    /* read write device */
+#define        FSTAB_RO        "ro"    /* read only device */
+#define        FSTAB_SW        "sw"    /* swap device */
+#define        FSTAB_XX        "xx"    /* ignore totally */
+
+struct fstab{
+       char    fs_spec[FSNMLG];        /* block special device name */
+       char    fs_file[FSNMLG];        /* file system path prefix */
+       char    fs_type[3];             /* rw,ro,sw or xx */
+       int     fs_freq;                /* dump frequency, in days */
+       int     fs_passno;              /* pass number on parallel dump */
+};
+
+struct fstab *getfsent();
+struct fstab *getfsspec();
+struct fstab *getfsfile();
+int    setfsent();
+int    endfsent();
diff --git a/usr/include/grp.h b/usr/include/grp.h
new file mode 100644 (file)
index 0000000..59ad28c
--- /dev/null
@@ -0,0 +1,6 @@
+struct group { /* see getgrent(3) */
+       char    *gr_name;
+       char    *gr_passwd;
+       int     gr_gid;
+       char    **gr_mem;
+};
diff --git a/usr/include/lastlog.h b/usr/include/lastlog.h
new file mode 100644 (file)
index 0000000..c7dbc57
--- /dev/null
@@ -0,0 +1,4 @@
+struct lastlog {
+       time_t  ll_time;
+       char    ll_line[8];
+};
diff --git a/usr/include/mp.h b/usr/include/mp.h
new file mode 100644 (file)
index 0000000..5fa2116
--- /dev/null
@@ -0,0 +1,33 @@
+#define MINT struct mint
+MINT
+{      int len;
+       short *val;
+};
+#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}}
+#ifndef DBG
+#define shfree(u) free((char *)u)
+#else
+#include "stdio.h"
+#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);}
+extern int dbg;
+#endif
+#ifndef vax
+struct half
+{      short high;
+       short low;
+};
+#else
+struct half
+{      short low;
+       short high;
+};
+#endif
+extern MINT *itom();
+extern short *xalloc();
+
+#ifdef lint
+extern xv_oid;
+#define VOID xv_oid =
+#else
+#define VOID
+#endif
diff --git a/usr/include/mtab.h b/usr/include/mtab.h
new file mode 100644 (file)
index 0000000..ab72873
--- /dev/null
@@ -0,0 +1,4 @@
+struct mtab {
+       char    m_path[32];             /* mounted on pathname */
+       char    m_dname[32];            /* block device pathname */
+};
diff --git a/usr/include/nlist.h b/usr/include/nlist.h
new file mode 100644 (file)
index 0000000..c6b7f97
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Format of a symbol table entry; this file is included by <a.out.h>
+ * and should be used if you aren't interested the a.out header
+ * or relocation information.
+ */
+struct nlist {
+       char    *n_name;        /* for use when in-core */
+       unsigned char n_type;   /* type flag, i.e. N_TEXT etc; see below */
+       char    n_other;        /* unused */
+       short   n_desc;         /* see <stab.h> */
+       unsigned long n_value;  /* value of this symbol (or sdb offset) */
+};
+#define        n_hash  n_desc          /* used internally by ld */
+
+/*
+ * Simple values for n_type.
+ */
+#define        N_UNDF  0x0             /* undefined */
+#define        N_ABS   0x2             /* absolute */
+#define        N_TEXT  0x4             /* text */
+#define        N_DATA  0x6             /* data */
+#define        N_BSS   0x8             /* bss */
+#define        N_COMM  0x12            /* common (internal to ld) */
+#define        N_FN    0x1f            /* file name symbol */
+
+#define        N_EXT   01              /* external bit, or'ed in */
+#define        N_TYPE  0x1e            /* mask for all the type bits */
+
+/*
+ * Sdb entries have some of the N_STAB bits set.
+ * These are given in <stab.h>
+ */
+#define        N_STAB  0xe0            /* if any of these bits set, a SDB entry */
+
+/*
+ * Format for namelist values.
+ */
+#define        N_FORMAT        "%08x"
diff --git a/usr/include/olddump.h b/usr/include/olddump.h
new file mode 100644 (file)
index 0000000..7ebb959
--- /dev/null
@@ -0,0 +1,92 @@
+#define MAXSIZE        500             /* max size in blocks of dumped files */
+#define NILIST 100             /* max files extracted at once */
+#define BFACT  20              /* tape blocking factor */
+
+int tden 1600;                 /* tape density */
+int tlen 2200;                 /* tape length (feet) */
+
+char *dump_cmd[] = {           /* default args for dump */
+       "dump",
+       "i",
+       "/dev/rp0",
+       0
+};
+
+char *rest_cmd[] = {           /* defaults for restor */
+       "restor",
+       "t",
+       0
+};
+
+char   *tape   "/dev/rmt1";
+char   dfile[] "/dev/dtab";
+char   tfile[] "/tmp/dtmp";
+char   name[100];
+
+#define NDTAB  10
+struct {
+       char    dt_name[16];
+       time_t  dt_date;
+} dtab[NDTAB];
+
+struct thdr {
+       ino_t   isize;
+       ino_t   maxi;
+       daddr_t fsize;
+       time_t  cdate;
+       time_t  ddate;
+       long    tsize;
+       int     nflg;
+};
+
+struct fhdr {
+       short   xmagic;
+       ino_t   xino;
+       short   xmode;
+       short   xnlink;
+       short   xuid;
+       short   xgid;
+       daddr_t xaddr;
+       off_t   xsize;
+       time_t  xatime;
+       time_t  xmtime;
+       time_t  xctime;
+};
+#define        FMAGIC  012345
+#define        SMAGIC  031415
+
+#define DAPTB  127     /* (BSIZE-2*sizeof(short))/sizeof(daddr_t)) */
+
+FILE   *tmpf;
+
+long
+getsize()
+{
+       register c;
+       long j;
+
+       c = getc(tmpf);
+       if(c == EOF)
+               return((long)-1);
+       if(c <= 253)
+               return((long)c);
+       if(c == 255)
+               return((long)-1);
+       j = 0;
+       for(c=0;c<3;c++)
+               j = (j<<8) + (getc(tmpf)&0377);
+       return(j);
+}
+
+putsize(s)
+long   s;
+{
+       if(s <= 253) {
+               putc((char)s, tmpf);
+               return;
+       }
+       putc(254, tmpf);
+       putc((char)(s>>16), tmpf);
+       putc((char)(s>>8), tmpf);
+       putc((char)s, tmpf);
+}
diff --git a/usr/include/pagsiz.h b/usr/include/pagsiz.h
new file mode 100644 (file)
index 0000000..3a30b24
--- /dev/null
@@ -0,0 +1,9 @@
+#define        NBPG    512
+#define        PGOFSET 511
+#define        CLSIZE  2
+#define        CLOFSET 1023
+#define        BSIZE   1024
+#define        BMASK   1023
+#define        BSHIFT  10
+#define        PAGSIZ  (NBPG*CLSIZE)
+#define        PAGRND  ((PAGSIZ)-1)
diff --git a/usr/include/pwd.h b/usr/include/pwd.h
new file mode 100644 (file)
index 0000000..1fa1b38
--- /dev/null
@@ -0,0 +1,11 @@
+struct passwd { /* see getpwent(3) */
+       char    *pw_name;
+       char    *pw_passwd;
+       int     pw_uid;
+       int     pw_gid;
+       int     pw_quota;
+       char    *pw_comment;
+       char    *pw_gecos;
+       char    *pw_dir;
+       char    *pw_shell;
+};
diff --git a/usr/include/ranlib.h b/usr/include/ranlib.h
new file mode 100644 (file)
index 0000000..13b3f2e
--- /dev/null
@@ -0,0 +1,16 @@
+
+/*
+ * Structure of the __.SYMDEF table of contents for an archive.
+ * __.SYMDEF begins with a word giving the number of ranlib structures
+ * which immediately follow, and then continues with a string
+ * table consisting of a word giving the number of bytes of strings
+ * which follow and then the strings themselves.
+ * The ran_strx fields index the string table whose first byte is numbered 0.
+ */
+struct ranlib {
+       union {
+               off_t   ran_strx;       /* string table index of */
+               char    *ran_name;      /* symbol defined by */
+       } ran_un;
+       off_t   ran_off;                /* library member at this offset */
+};
diff --git a/usr/include/saio.h b/usr/include/saio.h
new file mode 100644 (file)
index 0000000..d8b4f71
--- /dev/null
@@ -0,0 +1,59 @@
+/*     %M%     %I%     %G%     */
+
+/*
+ * header file for standalone package
+ */
+
+/*
+ * io block: includes an
+ * inode, cells for the use of seek, etc,
+ * and a buffer.
+ */
+struct iob {
+       char    i_flgs;
+       struct  inode i_ino;
+       int     i_unit;
+       daddr_t i_boff;
+       daddr_t i_cyloff;
+       off_t   i_offset;
+       daddr_t i_bn;
+       char    *i_ma;
+       int     i_cc;
+       char    i_buf[BSIZE];
+};
+
+#define F_READ 01
+#define F_WRITE        02
+#define F_ALLOC        04
+#define F_FILE 010
+
+/*
+ * dev switch
+ */
+struct devsw {
+       char    *dv_name;
+       int     (*dv_strategy)();
+       int     (*dv_open)();
+       int     (*dv_close)();
+};
+
+struct devsw devsw[];
+
+/*
+ * request codes. Must be the same a F_XXX above
+ */
+#define        READ    1
+#define        WRITE   2
+
+#define        NBUFS   4
+
+char   b[NBUFS][BSIZE];
+daddr_t        blknos[NBUFS];
+
+#define NFILES 4
+struct iob iob[NFILES];
+
+#define        PHYSUBA0        0x20006000
+#define        PHYSMBA0        0x20010000
+#define        PHYSMBA1        0x20012000
+#define        PHYSUMEM        0x2013e000
diff --git a/usr/include/sccs.h b/usr/include/sccs.h
new file mode 100644 (file)
index 0000000..16570db
--- /dev/null
@@ -0,0 +1 @@
+#define SCCSID(arg) static char Sccsid[] = "arg";
diff --git a/usr/include/setjmp.h b/usr/include/setjmp.h
new file mode 100644 (file)
index 0000000..e1cb175
--- /dev/null
@@ -0,0 +1 @@
+typedef int jmp_buf[10];
diff --git a/usr/include/sgtty.h b/usr/include/sgtty.h
new file mode 100644 (file)
index 0000000..f599a45
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Structure for stty and gtty system calls.
+ */
+
+#ifndef        _IOCTL_
+#include <sys/ioctl.h>
+#endif
+
+struct sgttyb {
+       char    sg_ispeed;              /* input speed */
+       char    sg_ospeed;              /* output speed */
+       char    sg_erase;               /* erase character */
+       char    sg_kill;                /* kill character */
+       short   sg_flags;               /* mode flags */
+};
+
+/*
+ * Modes
+ */
+#define        TANDEM  01
+#define        CBREAK  02
+#define        LCASE   04
+#define        ECHO    010
+#define        CRMOD   020
+#define        RAW     040
+#define        ODDP    0100
+#define        EVENP   0200
+#define ANYP   0300
+#define        NLDELAY 001400
+#define        TBDELAY 006000
+#define        XTABS   06000
+#define        CRDELAY 030000
+#define        VTDELAY 040000
+#define BSDELAY 0100000
+#define ALLDELAY 0177400
+
+/*
+ * Delay algorithms
+ */
+#define        CR0     0
+#define        CR1     010000
+#define        CR2     020000
+#define        CR3     030000
+#define        NL0     0
+#define        NL1     000400
+#define        NL2     001000
+#define        NL3     001400
+#define        TAB0    0
+#define        TAB1    002000
+#define        TAB2    004000
+#define        FF0     0
+#define        FF1     040000
+#define        BS0     0
+#define        BS1     0100000
+
+/*
+ * Speeds
+ */
+#define B0     0
+#define B50    1
+#define B75    2
+#define B110   3
+#define B134   4
+#define B150   5
+#define B200   6
+#define B300   7
+#define B600   8
+#define B1200  9
+#define        B1800   10
+#define B2400  11
+#define B4800  12
+#define B9600  13
+#define EXTA   14
+#define EXTB   15
diff --git a/usr/include/signal.h b/usr/include/signal.h
new file mode 100644 (file)
index 0000000..5857168
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef        NSIG
+#define NSIG   32
+
+#define        SIGHUP  1       /* hangup */
+#define        SIGINT  2       /* interrupt */
+#define        SIGQUIT 3       /* quit */
+#define        SIGILL  4       /* illegal instruction (not reset when caught) */
+#define            ILL_RESAD_FAULT     0x0     /* reserved addressing fault */
+#define            ILL_PRIVIN_FAULT    0x1     /* privileged instruction fault */
+#define            ILL_RESOP_FAULT     0x2     /* reserved operand fault */
+/* CHME, CHMS, CHMU are not yet given back to users reasonably */
+#define        SIGTRAP 5       /* trace trap (not reset when caught) */
+#define        SIGIOT  6       /* IOT instruction */
+#define        SIGEMT  7       /* EMT instruction */
+#define        SIGFPE  8       /* floating point exception */
+#define            FPE_INTOVF_TRAP     0x1     /* integer overflow */
+#define            FPE_INTDIV_TRAP     0x2     /* integer divide by zero */
+#define            FPE_FLTOVF_TRAP     0x3     /* floating overflow */
+#define            FPE_FLTDIV_TRAP     0x4     /* floating/decimal divide by zero */
+#define            FPE_FLTUND_TRAP     0x5     /* floating underflow */
+#define            FPE_DECOVF_TRAP     0x6     /* decimal overflow */
+#define            FPE_SUBRNG_TRAP     0x7     /* subscript out of range */
+#define            FPE_FLTOVF_FAULT    0x8     /* floating overflow fault */
+#define            FPE_FLTDIV_FAULT    0x9     /* divide by zero floating fault */
+#define            FPE_FLTUND_FAULT    0xa     /* floating underflow fault */
+#define        SIGKILL 9       /* kill (cannot be caught or ignored) */
+#define        SIGBUS  10      /* bus error */
+#define        SIGSEGV 11      /* segmentation violation */
+#define        SIGSYS  12      /* bad argument to system call */
+#define        SIGPIPE 13      /* write on a pipe with no one to read it */
+#define        SIGALRM 14      /* alarm clock */
+#define        SIGTERM 15      /* software termination signal from kill */
+
+#define        SIGSTOP 17      /* sendable stop signal not from tty */
+#define        SIGTSTP 18      /* stop signal from tty */
+#define        SIGCONT 19      /* continue a stopped process */
+#define        SIGCHLD 20      /* to parent on child stop or exit */
+#define        SIGTTIN 21      /* to readers pgrp upon background tty read */
+#define        SIGTTOU 22      /* like TTIN for output if (tp->t_local&LTOSTOP) */
+#define SIGTINT        23      /* to pgrp on every input character if LINTRUP */
+#define        SIGXCPU 24      /* exceeded CPU time limit */
+#define        SIGXFSZ 25      /* exceeded file size limit */
+
+#ifndef KERNEL
+int    (*signal())();
+#endif
+
+#define        BADSIG          (int (*)())-1
+#define        SIG_DFL         (int (*)())0
+#define        SIG_IGN         (int (*)())1
+#ifdef KERNEL
+#define        SIG_CATCH       (int (*)())2
+#endif
+#define        SIG_HOLD        (int (*)())3
+
+#define        SIGISDEFER(x)   (((int)(x) & 1) != 0)
+#define        SIGUNDEFER(x)   (int (*)())((int)(x) &~ 1)
+#define        DEFERSIG(x)     (int (*)())((int)(x) | 1)
+
+#define        SIGNUMMASK      0377            /* to extract pure signal number */
+#define        SIGDOPAUSE      0400            /* do pause after setting action */
+#define        SIGDORTI        01000           /* do ret+rti after setting action */
+#endif
diff --git a/usr/include/stab.h b/usr/include/stab.h
new file mode 100644 (file)
index 0000000..3c5c31e
--- /dev/null
@@ -0,0 +1,34 @@
+/* IF YOU ADD DEFINITIONS, ADD THEM TO nm.c as well */
+/*
+ * This file gives definitions supplementing <a.out.h>
+ * for permanent symbol table entries.
+ * These must have one of the N_STAB bits on,
+ * and are subject to relocation according to the masks in <a.out.h>.
+ */
+/*
+ * for symbolic debugger, sdb(1):
+ */
+#define        N_GSYM  0x20            /* global symbol: name,,0,type,0 */
+#define        N_FNAME 0x22            /* procedure name (f77 kludge): name,,0 */
+#define        N_FUN   0x24            /* procedure: name,,0,linenumber,address */
+#define        N_STSYM 0x26            /* static symbol: name,,0,type,address */
+#define        N_LCSYM 0x28            /* .lcomm symbol: name,,0,type,address */
+#define        N_RSYM  0x40            /* register sym: name,,0,type,register */
+#define        N_SLINE 0x44            /* src line: 0,,0,linenumber,address */
+#define        N_SSYM  0x60            /* structure elt: name,,0,type,struct_offset */
+#define        N_SO    0x64            /* source file name: name,,0,0,address */
+#define        N_LSYM  0x80            /* local sym: name,,0,type,offset */
+#define        N_SOL   0x84            /* #included file name: name,,0,0,address */
+#define        N_PSYM  0xa0            /* parameter: name,,0,type,offset */
+#define        N_ENTRY 0xa4            /* alternate entry: name,linenumber,address */
+#define        N_LBRAC 0xc0            /* left bracket: 0,,0,nesting level,address */
+#define        N_RBRAC 0xe0            /* right bracket: 0,,0,nesting level,address */
+#define        N_BCOMM 0xe2            /* begin common: name,, */
+#define        N_ECOMM 0xe4            /* end common: name,, */
+#define        N_ECOML 0xe8            /* end common (local name): ,,address */
+#define        N_LENG  0xfe            /* second stab entry with length information */
+
+/*
+ * for the berkeley pascal compiler, pc(1):
+ */
+#define        N_PC    0x30            /* global pascal symbol: name,,0,subtype,line */
diff --git a/usr/include/stat.h b/usr/include/stat.h
new file mode 100644 (file)
index 0000000..1468bde
--- /dev/null
@@ -0,0 +1,28 @@
+struct stat
+{
+       dev_t   st_dev;
+       ino_t   st_ino;
+       unsigned short  st_mode;
+       short   st_nlink;
+       short   st_uid;
+       short   st_gid;
+       dev_t   st_rdev;
+       off_t   st_size;
+       time_t  st_atime;
+       time_t  st_mtime;
+       time_t  st_ctime;
+};
+
+#define        S_IFMT  0170000         /* type of file */
+#define                S_IFDIR 0040000 /* directory */
+#define                S_IFCHR 0020000 /* character special */
+#define                S_IFBLK 0060000 /* block special */
+#define                S_IFREG 0100000 /* regular */
+#define                S_IFMPC 0030000 /* multiplexed char special */
+#define                S_IFMPB 0070000 /* multiplexed block special */
+#define        S_ISUID 0004000         /* set user id on execution */
+#define        S_ISGID 0002000         /* set group id on execution */
+#define        S_ISVTX 0001000         /* save swapped text even after use */
+#define        S_IREAD 0000400         /* read permission, owner */
+#define        S_IWRITE        0000200         /* write permission, owner */
+#define        S_IEXEC 0000100         /* execute/search permission, owner */
diff --git a/usr/include/sys.s b/usr/include/sys.s
new file mode 100644 (file)
index 0000000..248065c
--- /dev/null
@@ -0,0 +1,65 @@
+       .set    exit,1
+       .set    fork,2
+       .set    read,3
+       .set    write,4
+       .set    open,5
+       .set    close,6
+       .set    wait,7
+       .set    creat,8
+       .set    link,9
+       .set    unlink,10
+       .set    exec,11
+       .set    chdir,12
+       .set    time,13
+       .set    mknod,14
+       .set    chmod,15
+       .set    chown,16
+       .set    break,17
+       .set    stat,18
+       .set    lseek,19
+       .set    getpid,20
+       .set    mount,21
+       .set    umount,22
+       .set    setuid,23
+       .set    getuid,24
+       .set    stime,25
+       .set    ptrace,26
+       .set    alarm,27
+       .set    fstat,28
+       .set    pause,29
+       .set    utime,30
+       .set    smdate,30
+       .set    stty,31
+       .set    gtty,32
+       .set    access,33
+       .set    nice,34
+       .set    ftime,35
+       .set    sync,36
+       .set    kill,37
+#      .set    switch,38               # inoperative
+       .set    setpgrp,39
+#      .set    tell,40                 # obsolete
+       .set    dup,41
+       .set    pipe,42
+       .set    times,43
+       .set    prof,44
+       .set    setgid,46
+       .set    getgid,47
+       .set    signal,48
+#      USG 49
+#      USG 50
+       .set    acct,51
+       .set    setphys,52
+       .set    syslock,53
+       .set    ioctl,54
+#      .set    reboot,55
+       .set    mpx,56
+#      USG 57
+#      USG 58
+       .set    exece,59
+       .set    umask,60
+       .set    chroot,61
+#      LOCAL 62
+       .set    vfork,66
+       .set    vread,67
+       .set    vwrite,68
diff --git a/usr/include/sysexits.h b/usr/include/sysexits.h
new file mode 100644 (file)
index 0000000..71e736b
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+**  SYSEXITS.H -- Exit status codes for system programs.
+**
+**     This include file attempts to categorize possible error
+**     exit statuses for system programs, notably delivermail
+**     and the Berkeley network.
+**
+**     Error numbers begin at EX__BASE to reduce the possibility of
+**     clashing with other exit statuses that random programs may
+**     already return.  The meaning of the codes is approximately
+**     as follows:
+**
+**     EX_USAGE -- The command was used incorrectly, e.g., with
+**             the wrong number of arguments, a bad flag, a bad
+**             syntax in a parameter, or whatever.
+**     EX_DATAERR -- The input data was incorrect in some way.
+**             This should only be used for user's data & not
+**             system files.
+**     EX_NOINPUT -- An input file (not a system file) did not
+**             exist or was not readable.  This could also include
+**             errors like "No message" to a mailer (if it cared
+**             to catch it).
+**     EX_NOUSER -- The user specified did not exist.  This might
+**             be used for mail addresses or remote logins.
+**     EX_NOHOST -- The host specified did not exist.  This is used
+**             in mail addresses or network requests.
+**     EX_UNAVAILABLE -- A service is unavailable.  This can occur
+**             if a support program or file does not exist.  This
+**             can also be used as a catchall message when something
+**             you wanted to do doesn't work, but you don't know
+**             why.
+**     EX_SOFTWARE -- An internal software error has been detected.
+**             This should be limited to non-operating system related
+**             errors as possible.
+**     EX_OSERR -- An operating system error has been detected.
+**             This is intended to be used for such things as "cannot
+**             fork", "cannot create pipe", or the like.  It includes
+**             things like getuid returning a user that does not
+**             exist in the passwd file.
+**     EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
+**             etc.) does not exist, cannot be opened, or has some
+**             sort of error (e.g., syntax error).
+**     EX_CANTCREAT -- A (user specified) output file cannot be
+**             created.
+**     EX_IOERR -- An error occurred while doing I/O on some file.
+*/
+
+# define EX_OK         0       /* successful termination */
+
+# define EX__BASE      64      /* base value for error messages */
+
+# define EX_USAGE      64      /* command line usage error */
+# define EX_DATAERR    65      /* data format error */
+# define EX_NOINPUT    66      /* cannot open input */
+# define EX_NOUSER     67      /* addressee unknown */
+# define EX_NOHOST     68      /* host name unknown */
+# define EX_UNAVAILABLE        69      /* service unavailable */
+# define EX_SOFTWARE   70      /* internal software error */
+# define EX_OSERR      71      /* system error (e.g., can't fork) */
+# define EX_OSFILE     72      /* critical OS file missing */
+# define EX_CANTCREAT  73      /* can't create (user) output file */
+# define EX_IOERR      74      /* input/output error */
diff --git a/usr/include/time.h b/usr/include/time.h
new file mode 100644 (file)
index 0000000..7eeb1e1
--- /dev/null
@@ -0,0 +1,11 @@
+struct tm { /* see ctime(3) */
+       int     tm_sec;
+       int     tm_min;
+       int     tm_hour;
+       int     tm_mday;
+       int     tm_mon;
+       int     tm_year;
+       int     tm_wday;
+       int     tm_yday;
+       int     tm_isdst;
+};
diff --git a/usr/include/utmp.h b/usr/include/utmp.h
new file mode 100644 (file)
index 0000000..25f22e3
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * Structure of utmp and wtmp files.
+ *
+ * Assuming the number 8 is unwise.
+ */
+struct utmp {
+       char    ut_line[8];             /* tty name */
+       char    ut_name[8];             /* user id */
+       long    ut_time;                /* time on */
+};
diff --git a/usr/include/valign.h b/usr/include/valign.h
new file mode 100644 (file)
index 0000000..af5298c
--- /dev/null
@@ -0,0 +1 @@
+#define        VALSIZ  1024
diff --git a/usr/include/varargs.h b/usr/include/varargs.h
new file mode 100644 (file)
index 0000000..da1d099
--- /dev/null
@@ -0,0 +1,5 @@
+typedef char *va_list;
+# define va_dcl int va_alist;
+# define va_start(list) list = (char *) &va_alist
+# define va_end(list)
+# define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
diff --git a/usr/include/vfont.h b/usr/include/vfont.h
new file mode 100644 (file)
index 0000000..f24f24c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * The structures header and dispatch define the format of a font file.
+ *
+ * See vfont(5) for more details.
+ */
+struct header {
+       short magic;
+       unsigned short size;
+       short maxx;
+       short maxy;
+       short xtend;
+}; 
+
+struct dispatch {
+       unsigned short addr;
+       short nbytes;
+       char up,down,left,right;
+       short width;
+};
diff --git a/usr/include/wait.h b/usr/include/wait.h
new file mode 100644 (file)
index 0000000..9681227
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * This file holds definitions relevent to the wait system call.
+ * Some of the options here are available only through the ``wait3''
+ * entry point; the old entry point with one argument has more fixed
+ * semantics, never returning status of unstopped children, hanging until
+ * a process terminates if any are outstanding, and never returns
+ * detailed information about process resource utilization (<vtimes.h>).
+ */
+
+/*
+ * Structure of the information in the first word returned by both
+ * wait and wait3.  If w_stopval==WSTOPPED, then the second structure
+ * describes the information returned, else the first.  See WUNTRACED below.
+ */
+union wait     {
+       int     w_status;               /* used in syscall */
+       /*
+        * Terminated process status.
+        */
+       struct {
+               unsigned short  w_Termsig:7;    /* termination signal */
+               unsigned short  w_Coredump:1;   /* core dump indicator */
+               unsigned short  w_Retcode:8;    /* exit code if w_termsig==0 */
+       } w_T;
+       /*
+        * Stopped process status.  Returned
+        * only for traced children unless requested
+        * with the WUNTRACED option bit.
+        */
+       struct {
+               unsigned short  w_Stopval:8;    /* == W_STOPPED if stopped */
+               unsigned short  w_Stopsig:8;    /* signal that stopped us */
+       } w_S;
+};
+#define        w_termsig       w_T.w_Termsig
+#define w_coredump     w_T.w_Coredump
+#define w_retcode      w_T.w_Retcode
+#define w_stopval      w_S.w_Stopval
+#define w_stopsig      w_S.w_Stopsig
+
+
+#define        WSTOPPED        0177    /* value of s.stopval if process is stopped */
+
+/*
+ * Option bits for the second argument of wait3.  WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0).  WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals.  If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#define WNOHANG                1       /* dont hang in wait */
+#define WUNTRACED      2       /* tell about stopped, untraced children */
+
+#define WIFSTOPPED(x)  ((x).w_stopval == WSTOPPED)
+#define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0)
+#define WIFEXITED(x)   ((x).w_stopval != WSTOPPED && (x).w_termsig == 0)
diff --git a/usr/include/whoami b/usr/include/whoami
new file mode 100644 (file)
index 0000000..6e4f438
--- /dev/null
@@ -0,0 +1 @@
+ARPAVAX
diff --git a/usr/include/whoami.h b/usr/include/whoami.h
new file mode 100644 (file)
index 0000000..5e58bf9
--- /dev/null
@@ -0,0 +1,2 @@
+#define AMNESIAVAX
+#define        sysname "amnesiavax"