+
+#ifdef USE_QFA
+/*
+ * get the current position of the tape
+ */
+int
+GetTapePos(long *pos)
+{
+ int err = 0;
+
+ *pos = 0;
+ if (ioctl(mt, MTIOCPOS, pos) == -1) {
+ err = errno;
+ fprintf(stdout, "[%ld] error: %d (getting tapepos: %ld)\n",
+ (unsigned long)getpid(), err, *pos);
+ return err;
+ }
+ return err;
+}
+
+typedef struct mt_pos {
+ short mt_op;
+ int mt_count;
+} MTPosRec, *MTPosPtr;
+
+/*
+ * go to specified position on tape
+ */
+int
+GotoTapePos(long pos)
+{
+ int err = 0;
+ struct mt_pos buf;
+
+ buf.mt_op = MTSEEK;
+ buf.mt_count = pos;
+ if (ioctl(mt, MTIOCTOP, &buf) == -1) {
+ err = errno;
+ fprintf(stdout, "[%ld] error: %d (setting tapepos: %ld)\n",
+ (unsigned long)getpid(), err, pos);
+ return err;
+ }
+ return err;
+}
+
+/*
+ * read next data from tape to re-sync
+ */
+void
+ReReadFromTape(void)
+{
+ FLUSHTAPEBUF();
+ noresyncmesg = 1;
+ if (gethead(&spcl) == FAIL) {
+#ifdef DEBUG_QFA
+ fprintf(stdout, "DEBUG 1 gethead failed\n");
+#endif
+ }
+ findinode(&spcl);
+ noresyncmesg = 0;
+}
+
+void
+RequestVol(long tnum)
+{
+ FLUSHTAPEBUF();
+ getvol(tnum);
+}
+#endif /* USE_QFA */