From: aej@manyjars.WPI.EDU (Allan E Johannesen)
Subject: Re: rdump from sun
Date: 21 May 91 01:23:12 GMT [thread overview]
Message-ID: <AEJ.91May20202312@manyjars.WPI.EDU> (raw)
In-Reply-To: sahayman@porbeagle.cs.indiana.edu's message of 20 May 91 21: 57:29 GMT
Yes, BSD rmt will handle an rdump from another UNIX box. Note,
however, that BSD rmt will fail if the rdump is from a DECstation. If
you want DECstation rdumps to work as well as Sun (or other) rdumps,
you have to hack in DEC's changes to the BSD rmt...
This was my guess at those changes:
*** rmt.c~bsd Mon May 20 20:18:51 1991
--- rmt.c Sat Mar 16 13:26:13 1991
***************
*** 22,27 ****
--- 22,32 ----
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/mtio.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+ #include <sys/devio.h>
+ #include <sys/param.h>
+ #include <sys/fs.h>
#include <errno.h>
int tape = -1;
***************
*** 30,41 ****
int maxrecsize = -1;
char *checkbuf();
! #define SSIZE 64
! char device[SSIZE];
! char count[SSIZE], mode[SSIZE], pos[SSIZE], op[SSIZE];
extern errno;
! char *sys_errlist[];
char resp[BUFSIZ];
char *sprintf();
--- 35,46 ----
int maxrecsize = -1;
char *checkbuf();
! #define aSSIZE 64
! char device[aSSIZE];
! char count[aSSIZE], mode[aSSIZE], pos[aSSIZE], op[aSSIZE];
extern errno;
! extern char *sys_errlist[];
char resp[BUFSIZ];
char *sprintf();
***************
*** 54,62 ****
char c;
int n, i, cc;
! argc--, argv++;
! if (argc > 0) {
! debug = fopen(*argv, "w");
if (debug == 0)
exit(1);
(void) setbuf(debug, (char *)0);
--- 59,66 ----
char c;
int n, i, cc;
! {
! debug = fopen("/tmp/debrmt", "w");
if (debug == 0)
exit(1);
(void) setbuf(debug, (char *)0);
***************
*** 148,153 ****
--- 152,197 ----
goto top;
}
+ /* my guess as the DEC "enhanncements"... */
+
+ case 'T':
+ getstring(device);
+ DEBUG1("rmtd: T %s\n",device);
+ { struct stat sts;
+ if (stat(device,&sts) != 0)
+ goto ioerror;
+ rval = sizeof(sts);
+ (void) sprintf(resp,"A%d\n",rval);
+ (void) write(1,resp,strlen(resp));
+ (void) write(1,(char *)&sts,sizeof(sts));
+ goto top; }
+
+ case 'D':
+ if (read(0, &c, 1) != 1)
+ exit(0); /* gobble linefeed */
+ DEBUG("rmtd: D\n");
+ { struct devget dvg;
+ if (ioctl(tape,DEVIOCGET,(char *)&dvg) != 0)
+ goto ioerror;
+ rval = sizeof(dvg);
+ (void) sprintf(resp,"A%d\n",rval);
+ (void) write(1,resp,strlen(resp));
+ (void) write(1,(char *)&dvg,sizeof(dvg));
+ goto top; }
+
+ case 'P':
+ if (read(0,&c,1) != 1)
+ exit(0);
+ DEBUG("rmtd: P\n");
+ { struct pt ptab;
+ if (ioctl(tape,DIOCDGTPT,(char *)&ptab) != 0)
+ goto ioerror;
+ rval = sizeof(ptab);
+ (void) sprintf(resp,"A%d\n",rval);
+ (void) write(1,resp,strlen(resp));
+ (void) write(1,(char *)&ptab,sizeof(ptab));
+ goto top; }
+
default:
DEBUG1("rmtd: garbage command %c\n", c);
exit(3);
***************
*** 168,174 ****
int i;
char *cp = bp;
! for (i = 0; i < SSIZE; i++) {
if (read(0, cp+i, 1) != 1)
exit(0);
if (cp[i] == '\n')
--- 212,218 ----
int i;
char *cp = bp;
! for (i = 0; i < aSSIZE; i++) {
if (read(0, cp+i, 1) != 1)
exit(0);
if (cp[i] == '\n')
next prev parent reply other threads:[~1991-05-21 1:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-05-20 21:57 rdump from sun Steve Hayman
1991-05-21 1:23 ` Allan E Johannesen [this message]
1991-05-23 9:47 ` Andy Pearman
1991-05-23 20:32 ` Dan Ehrlich
1991-06-07 17:11 ` Robert Perlberg
1991-05-24 11:20 ` Giles Carre
1991-05-24 18:42 ` George Robbins
-- strict thread matches above, loose matches on Subject: below --
1991-05-20 20:06 Bill Wang
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox