Xref: utzoo comp.sys.dec:5797 comp.unix.ultrix:7292 alt.sys.sun:3939 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!crackers!m2c!wpi.WPI.EDU!wpi!aej From: aej@manyjars.WPI.EDU (Allan E Johannesen) Newsgroups: comp.sys.dec,comp.unix.ultrix,alt.sys.sun Subject: Re: rdump from sun Message-ID: Date: 21 May 91 01:23:12 GMT References: <1991May20.165748.16663@news.cs.indiana.edu> Sender: news@wpi.WPI.EDU (News) Organization: Worcester Polytechnic Institute, Worcester, MA 01609-2280 Lines: 136 In-Reply-To: sahayman@porbeagle.cs.indiana.edu's message of 20 May 91 21: 57:29 GMT Nntp-Posting-Host: manyjars.wpi.edu 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 #include #include + #include + #include + #include + #include + #include #include 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')