[comp.sys.sun] using ioctl in a C program to talk to the tape drive

yun@bu-ast.bu.edu (Joao Lin Yun) (06/05/91)

I have been trying to talk to a Xylogics tape drive using a C program with
ioctl commands, like this:

Part of the subroutine which tries to talk to the Xylogics:

   struct mtop op;

         *fd = open("/dev/nrmt8", O_RDWR);

      op.mt_op = MTREW;
      *status = ioctl(*fd, MTIOCTOP, &op);
      if (*status < 0) {
         perror("mtio:");
	return;
	}

For a reason that I am unable to find I get an error message saying:

	"mtio: ioctl not appropriate for device"

I cannot get an ioctl to work. The tape drive is ok. It responds nicely to
mt and dd commands. It opens the device nicely returning an fd value of 8.

I've been told (by the people who provided this code) that it works fine with
their SCSI drive (/dev/nrst8 instead of /dev/nrmt8). Can someone tell me what 
the problem is and how to solve it?