BSD 4_3 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Thu, 28 Apr 1983 07:03:05 +0000 (23:03 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Thu, 28 Apr 1983 07:03:05 +0000 (23:03 -0800)
Work on file usr/src/etc/dump.4.1/include.4.1/sys/stat.h
Work on file usr/src/etc/dump.4.1/include.4.1/sys/filsys.h
Work on file usr/src/etc/dump.4.1/include.4.1/sys/inode.h
Work on file usr/src/etc/dump.4.1/include.4.1/sys/ino.h
Work on file usr/src/etc/dump.4.1/include.4.1/sys/fblk.h
Work on file usr/src/etc/dump.4.1/include.4.1/sys/dir.h
Work on file usr/src/etc/dump.4.1/include.4.1/time.h
Work on file usr/src/etc/dump.4.1/include.4.1/dumprestor.h
Work on file usr/src/etc/dump.4.1/include.4.1/sys/types.h

Synthesized-from: CSRG/cd1/4.3

usr/src/etc/dump.4.1/include.4.1/dumprestor.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/dir.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/fblk.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/filsys.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/ino.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/inode.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/stat.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/sys/types.h [new file with mode: 0644]
usr/src/etc/dump.4.1/include.4.1/time.h [new file with mode: 0644]

diff --git a/usr/src/etc/dump.4.1/include.4.1/dumprestor.h b/usr/src/etc/dump.4.1/include.4.1/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/src/etc/dump.4.1/include.4.1/sys/dir.h b/usr/src/etc/dump.4.1/include.4.1/sys/dir.h
new file mode 100644 (file)
index 0000000..c978a72
--- /dev/null
@@ -0,0 +1,10 @@
+/*     dir.h   4.2     81/02/19        */
+
+#ifndef        DIRSIZ
+#define        DIRSIZ  14
+#endif
+struct direct
+{
+       ino_t   d_ino;
+       char    d_name[DIRSIZ];
+};
diff --git a/usr/src/etc/dump.4.1/include.4.1/sys/fblk.h b/usr/src/etc/dump.4.1/include.4.1/sys/fblk.h
new file mode 100644 (file)
index 0000000..64aadbe
--- /dev/null
@@ -0,0 +1,7 @@
+/*     fblk.h  4.2     81/02/19        */
+
+struct fblk
+{
+       int     df_nfree;
+       daddr_t df_free[NICFREE];
+};
diff --git a/usr/src/etc/dump.4.1/include.4.1/sys/filsys.h b/usr/src/etc/dump.4.1/include.4.1/sys/filsys.h
new file mode 100644 (file)
index 0000000..93632d1
--- /dev/null
@@ -0,0 +1,32 @@
+/*     filsys.h        4.3     81/03/03        */
+
+/*
+ * Structure of the super-block
+ */
+struct filsys
+{
+       unsigned short s_isize;         /* size in blocks of i-list */
+       daddr_t s_fsize;                /* size in blocks of entire volume */
+       short   s_nfree;                /* number of addresses in s_free */
+       daddr_t s_free[NICFREE];        /* free block list */
+       short   s_ninode;               /* number of i-nodes in s_inode */
+       ino_t   s_inode[NICINOD];       /* free i-node list */
+       char    s_flock;                /* lock during free list manipulation */
+       char    s_ilock;                /* lock during i-list manipulation */
+       char    s_fmod;                 /* super block modified flag */
+       char    s_ronly;                /* mounted read-only flag */
+       time_t  s_time;                 /* last super block update */
+       daddr_t s_tfree;                /* total free blocks*/
+       ino_t   s_tinode;               /* total free inodes */
+       short   s_dinfo[2];             /* interleave stuff */
+#define        s_m     s_dinfo[0]
+#define        s_n     s_dinfo[1]
+       char    s_fsmnt[12];            /* ordinary file mounted on */
+       /* end not maintained */
+       ino_t   s_lasti;                /* start place for circular search */
+       ino_t   s_nbehind;              /* est # free inodes before s_lasti */
+};
+
+#ifdef KERNEL
+struct filsys *getfs();
+#endif
diff --git a/usr/src/etc/dump.4.1/include.4.1/sys/ino.h b/usr/src/etc/dump.4.1/include.4.1/sys/ino.h
new file mode 100644 (file)
index 0000000..408c79f
--- /dev/null
@@ -0,0 +1,23 @@
+/*     ino.h   4.2     81/02/19        */
+
+/*
+ * Inode structure as it appears on
+ * a disk block.
+ */
+struct dinode
+{
+       unsigned short di_mode; /* mode and type of file */
+       short   di_nlink;       /* number of links to file */
+       short   di_uid;         /* owner's user id */
+       short   di_gid;         /* owner's group id */
+       off_t   di_size;        /* number of bytes in file */
+       char    di_addr[40];    /* disk block addresses */
+       time_t  di_atime;       /* time last accessed */
+       time_t  di_mtime;       /* time last modified */
+       time_t  di_ctime;       /* time created */
+};
+/*
+ * the 40 address bytes:
+ *     39 used; 13 addresses
+ *     of 3 bytes each.
+ */
diff --git a/usr/src/etc/dump.4.1/include.4.1/sys/inode.h b/usr/src/etc/dump.4.1/include.4.1/sys/inode.h
new file mode 100644 (file)
index 0000000..15efb10
--- /dev/null
@@ -0,0 +1,81 @@
+/*     inode.h 4.10    82/02/27        */
+
+/*
+ * The I node is the focus of all file activity in UNIX.
+ * There is a unique inode allocated for each active file,
+ * each current directory, each mounted-on file, text file, and the root.
+ * An inode is 'named' by its dev/inumber pair. (iget/iget.c)
+ * Data, from mode on, is read in from permanent inode on volume.
+ */
+#define        NADDR   13
+
+struct inode {
+       char    i_flag;
+       char    i_count;        /* reference count */
+       dev_t   i_dev;          /* device where inode resides */
+       ino_t   i_number;       /* i number, 1-to-1 with device address */
+/* begin read from disk */
+       u_short i_mode;
+       short   i_nlink;        /* directory entries */
+       short   i_uid;          /* owner */
+       short   i_gid;          /* group of owner */
+       off_t   i_size;         /* size of file */
+       union {
+               struct i_f {
+                       daddr_t if_addr[NADDR]; /* if normal file/directory */
+                       daddr_t if_lastr;       /* last read (read-ahead) */
+               } i_f;
+               struct i_d {
+                       daddr_t id_rdev;        /* i_addr[0] */
+               } i_d;
+               struct i_s {
+                       struct  socket *is_socket;
+               } i_s;
+#define        i_addr          i_f.if_addr
+#define        i_lastr         i_f.if_lastr
+#define        i_rdev          i_d.id_rdev
+#define        i_socket        i_s.is_socket
+       } i_un;
+/* end read from disk */
+       short   i_XXXXXX;       /* ### */
+/* SHOULD USE POINTERS, NOT INDICES, FOR HAS CHAIN */
+       short   i_hlink;        /* link in hash chain (iget/iput/ifind) */
+};
+
+#ifdef KERNEL
+struct inode *inode, *inodeNINODE;
+int    ninode;
+
+struct inode *rootdir;         /* pointer to inode of root directory */
+
+struct inode *ialloc();
+struct inode *ifind();
+struct inode *iget();
+struct inode *owner();
+struct inode *maknode();
+struct inode *namei();
+#endif
+
+/* flags */
+#define        ILOCK   01              /* inode is locked */
+#define        IUPD    02              /* file has been modified */
+#define        IACC    04              /* inode access time to be updated */
+#define        IMOUNT  010             /* inode is mounted on */
+#define        IWANT   020             /* some process waiting on lock */
+#define        ITEXT   040             /* inode is pure text prototype */
+#define        ICHG    0100            /* inode has been changed */
+
+/* modes */
+#define        IFMT    0170000         /* type of file */
+#define                IFCHR           0020000         /* character special */
+#define                IFDIR           0040000         /* directory */
+#define                IFBLK           0060000         /* block special */
+#define                IFREG           0100000         /* regular */
+#define                IFLNK           0120000         /* symbolic link */
+#define                IFPORTAL        0140000         /* portal */
+#define        ISUID   04000           /* set user id on execution */
+#define        ISGID   02000           /* set group id on execution */
+#define        ISVTX   01000           /* save swapped text even after use */
+#define        IREAD   0400            /* read, write, execute permissions */
+#define        IWRITE  0200
+#define        IEXEC   0100
diff --git a/usr/src/etc/dump.4.1/include.4.1/sys/stat.h b/usr/src/etc/dump.4.1/include.4.1/sys/stat.h
new file mode 100644 (file)
index 0000000..dc00dcd
--- /dev/null
@@ -0,0 +1,29 @@
+/*     stat.h  4.3     82/02/27        */
+
+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_IFLNK 0120000 /* symbolic link */
+#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/src/etc/dump.4.1/include.4.1/sys/types.h b/usr/src/etc/dump.4.1/include.4.1/sys/types.h
new file mode 100644 (file)
index 0000000..a93486d
--- /dev/null
@@ -0,0 +1,35 @@
+/*     types.h 4.3     81/10/17        */
+
+/*
+ * Basic system types and major/minor device constructing/busting macros.
+ */
+
+/* major part of a device */
+#define        major(x)        ((int)(((unsigned)(x)>>8)&0377))
+
+/* minor part of a device */
+#define        minor(x)        ((int)((x)&0377))
+
+/* make a device number */
+#define        makedev(x,y)    ((dev_t)(((x)<<8) | (y)))
+
+typedef        unsigned char   u_char;
+typedef        unsigned short  u_short;
+typedef        unsigned int    u_int;
+typedef        unsigned long   u_long;
+
+/* SHOULD USE long RATHER THAN int HERE BUT IT WOULD GIVE LINT ON THE KERNEL */
+/* GASTRIC DISTRESS AND DON'T HAVE TIME TO FIX THAT JUST NOW */
+typedef        struct  _physadr { int r[1]; } *physadr;
+typedef        int     daddr_t;
+typedef        char *  caddr_t;
+typedef        u_short ino_t;
+typedef        int     swblk_t;
+typedef        int     size_t;
+typedef        int     time_t;
+typedef        int     label_t[14];
+typedef        short   dev_t;
+typedef        int     off_t;
+typedef        long    portid_t;
+
+typedef        struct  fd_set { int fds_bits[1]; } fd_set;
diff --git a/usr/src/etc/dump.4.1/include.4.1/time.h b/usr/src/etc/dump.4.1/include.4.1/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;
+};