🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #8168

using ioctl in a C program to talk to the tape drive

#8168
From: Joao Lin Yun
Date: Tue, 04 Jun 1991 18:40
26 lines
1331 bytes
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?
Technical Details
Message-ID: <3304@brchh104.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request
From: yun@bu-ast.bu.edu (Joao Lin Yun)
Newsgroups: comp.sys.sun
Subject: using ioctl in a C program to talk to the tape drive
Keywords: No Digest Subjects in Unmoderated Mode
Message-ID: <3304@brchh104.bnr.ca>
Date: 4 Jun 91 18:40:00 GMT
Sender: news@brchh104.bnr.ca
Organization: Sunspots, Psuedo-Unmoderated
Lines: 27
Approved: sun-spots@rice.edu
X-Original-Date:    15 May 91 14:27:04 GMT