|
|
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 dump();
70: int tapsrec();
71: int dmpspc();
72: int dsrch();
73: int nullf();
74: char *getsuffix();
75: char *rawname();
76: struct dinode *getino();
77:
78: int interrupt(); /* in case operator bangs on console */
79:
80: #define HOUR (60L*60L)
81: #define DAY (24L*HOUR)
82: #define YEAR (365L*DAY)
83:
84: /*
85: * Exit status codes
86: */
87: #define X_FINOK 1 /* normal exit */
88: #define X_REWRITE 2 /* restart writing from the check point */
89: #define X_ABORT 3 /* abort all of dump; don't attempt checkpointing*/
90:
91: #define NINCREM "/etc/dumpdates" /*new format incremental info*/
92: #define TEMP "/etc/dtmp" /*output temp file*/
93:
94: #define TAPE "/dev/rmt8" /* default tape device */
95: #define DISK "/dev/rrp1g" /* default disk */
96: #define OPGRENT "operator" /* group entry to notify */
97: #define DIALUP "ttyd" /* prefix for dialups */
98:
99: struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
100:
101: /*
102: * The contents of the file NINCREM is maintained both on
103: * a linked list, and then (eventually) arrayified.
104: */
105: struct idates {
106: char id_name[MAXNAMLEN+3];
107: char id_incno;
108: time_t id_ddate;
109: };
110: struct itime{
111: struct idates it_value;
112: struct itime *it_next;
113: };
114: struct itime *ithead; /* head of the list version */
115: int nidates; /* number of records (might be zero) */
116: int idates_in; /* we have read the increment file */
117: struct idates **idatev; /* the arrayfied version */
118: #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
119:
120: /*
121: * We catch these interrupts
122: */
123: int sighup();
124: int sigquit();
125: int sigill();
126: int sigtrap();
127: int sigfpe();
128: int sigkill();
129: int sigbus();
130: int sigsegv();
131: int sigsys();
132: int sigalrm();
133: int sigterm();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.