- req = (struct req *)malloc(reqsiz+writesize); /* array of packets */
- tblock = (char (*)[TP_BSIZE]) &req[ntrec]; /* Tape buffer */
- return (req != NULL);
+ /*
+ * CDC 92181's and 92185's make 0.8" gaps in 1600-bpi start/stop mode
+ * (see DEC TU80 User's Guide). The shorter gaps of 6250-bpi require
+ * repositioning after stopping, i.e, streaming mode, where the gap is
+ * variable, 0.30" to 0.45". The gap is maximal when the tape stops.
+ */
+ tenths = writesize/density + (cartridge ? 16 : density == 625 ? 5 : 8);
+ /*
+ * Allocate tape buffer contiguous with the array of instruction
+ * packets, so flusht() can write them together with one write().
+ * Align tape buffer on page boundary to speed up tape write().
+ */
+ req = (struct req *)malloc(reqsiz + writesize + pgoff);
+ if (req == NULL)
+ return(0);
+ tblock = (char (*)[TP_BSIZE]) (((long)&req[ntrec] + pgoff) &~ pgoff);
+ req = (struct req *)tblock - ntrec;
+ return(1);