|
|
1.1 root 1: /* dump.h 1.12 83/07/01 */
2:
3: #define NI 16
4: #define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
5: #define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
6:
7: #include <stdio.h>
8: #include <ctype.h>
9: #include <sys/param.h>
10: #include <sys/stat.h>
11: #include <sys/fs.h>
12: #include <sys/inode.h>
13: #include <dumprestor.h>
14: #include <sys/dir.h>
15: #include <utmp.h>
16: #include <sys/time.h>
17: #include <signal.h>
18: #include <fstab.h>
19:
20: #define MWORD(m,i) (m[(unsigned)(i-1)/NBBY])
21: #define MBIT(i) (1<<((unsigned)(i-1)%NBBY))
22: #define BIS(i,w) (MWORD(w,i) |= MBIT(i))
23: #define BIC(i,w) (MWORD(w,i) &= ~MBIT(i))
24: #define BIT(i,w) (MWORD(w,i) & MBIT(i))
25:
26: int msiz;
27: char *clrmap;
28: char *dirmap;
29: char *nodmap;
30:
31: /*
32: * All calculations done in 0.1" units!
33: */
34:
35: char *disk; /* name of the disk file */
36: char *tape; /* name of the tape file */
37: char *increm; /* name of the file containing incremental information*/
38: char *temp; /* name of the file for doing rewrite of increm */
39: char lastincno; /* increment number of previous dump */
40: char incno; /* increment number */
41: int uflag; /* update flag */
42: int fi; /* disk file descriptor */
43: int to; /* tape file descriptor */
44: int pipeout; /* true => output to standard output */
45: ino_t ino; /* current inumber; used globally */
46: int nsubdir;
47: int newtape; /* new tape flag */
48: int nadded; /* number of added sub directories */
49: int dadded; /* directory added flag */
50: int density; /* density in 0.1" units */
51: long tsize; /* tape size in 0.1" units */
52: long esize; /* estimated tape size, blocks */
53: long asize; /* number of 0.1" units written on current tape */
54: int etapes; /* estimated number of tapes */
55:
56: int notify; /* notify operator flag */
57: int blockswritten; /* number of blocks written on current tape */
58: int tapeno; /* current tape number */
59: time_t tstart_writing; /* when started writing the first tape block */
60: char *processname;
61: struct fs *sblock; /* the file system super block */
62: char buf[MAXBSIZE];
63:
64: char *ctime();
65: char *prdate();
66: long atol();
67: int mark();
68: int add();
69: int dirdump();
70: int dump();
71: int tapsrec();
72: int dmpspc();
73: int dsrch();
74: int nullf();
75: char *getsuffix();
76: char *rawname();
77: struct dinode *getino();
78:
79: int interrupt(); /* in case operator bangs on console */
80:
81: #define HOUR (60L*60L)
82: #define DAY (24L*HOUR)
83: #define YEAR (365L*DAY)
84:
85: /*
86: * Exit status codes
87: */
88: #define X_FINOK 1 /* normal exit */
89: #define X_REWRITE 2 /* restart writing from the check point */
90: #define X_ABORT 3 /* abort all of dump; don't attempt checkpointing*/
91:
92: #define NINCREM "/etc/dumpdates" /*new format incremental info*/
93: #define TEMP "/etc/dtmp" /*output temp file*/
94:
95: #define TAPE "/dev/rcy0s" /* default tape device */
96: #define DISK "/dev/rfsd1c" /* default disk */
97: #define OPGRENT "operator" /* group entry to notify */
98: #define DIALUP "ttyd" /* prefix for dialups */
99:
100: struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
101:
102: /*
103: * The contents of the file NINCREM is maintained both on
104: * a linked list, and then (eventually) arrayified.
105: */
106: struct idates {
107: char id_name[MAXNAMLEN+3];
108: char id_incno;
109: time_t id_ddate;
110: };
111: struct itime{
112: struct idates it_value;
113: struct itime *it_next;
114: };
115: struct itime *ithead; /* head of the list version */
116: int nidates; /* number of records (might be zero) */
117: int idates_in; /* we have read the increment file */
118: struct idates **idatev; /* the arrayfied version */
119: #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
120:
121: /*
122: * We catch these interrupts
123: */
124: int sighup();
125: int sigquit();
126: int sigill();
127: int sigtrap();
128: int sigfpe();
129: int sigkill();
130: int sigbus();
131: int sigsegv();
132: int sigsys();
133: int sigalrm();
134: int sigterm();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.