-static
-openfiles()
-{
- if ((kmem = open(_PATH_KMEM, O_RDONLY, 0)) < 0) {
- (void)fprintf(stderr, "fstat: %s: %s\n",
- strerror(errno), _PATH_KMEM);
- exit(1);
- }
- if ((mem = open(_PATH_MEM, O_RDONLY, 0)) < 0) {
- (void)fprintf(stderr, "fstat: %s: %s\n",
- strerror(errno), _PATH_MEM);
- exit(1);
- }
- if ((swap = open(_PATH_DRUM, O_RDONLY, 0)) < 0) {
- (void)fprintf(stderr, "fstat: %s: %s\n",
- strerror(errno), _PATH_DRUM);
- exit(1);
- }
-}
-
-static
-rerr1(what, fromwhat)
- char *what, *fromwhat;
-{
- VP("error reading %s from %s", what, fromwhat);
-}
-
-static
-rerr2(address, what)
- int address;
- char *what;
-{
- VP("error %d reading %s at %x from %s\n", errno, what, address,
- _PATH_KMEM);
-}
-
-static long
-lgetw(loc)
- off_t loc;
-{
- long word;
-
- (void)lseek(kmem, (off_t)loc, L_SET);
- if (read(kmem, (char *)&word, sizeof(word)) != sizeof(word))
- rerr2((int)loc, "word");
- return(word);
-}
-
-static