Technical data
SunOS 5.5 Ioctl Requests mtio(7I)
If no data was written and the driver was opened for WRITE-ONLY access, one or two file
marks are written, thus creating a nullfile.
IOCTLS Not all devices support all ioctls. The driver returns an ENOTTY error on unsupported
ioctls.
The following structure definitions for magnetic tape ioctl commands are from
<sys/mtio.h>:
The minor device byte structure looks as follows:
15 7 6 5 4 3 2 1 0
Unit # BSD Reserved Density Density No rewind Unit #
Bits 7-15 behavior Select Select on Close Bits 0-1
/∗
∗ Layout of minor device byte:
∗/
#define MTUNIT(dev) (((minor(dev) & 0xff80) >> 5) +(minor(dev) & 0x3))
#define MT_NOREWIND (1 <<2)
#define MT_DENSITY_MASK (3 <<3)
#define MT_DENSITY1 (0 <<3) /∗ Lowest density/format ∗/
#define MT_DENSITY2 (1 <<3)
#define MT_DENSITY3 (2 <<3)
#define MT_DENSITY4 (3 <<3) /∗ Highest density/format ∗/
#define MTMINOR(unit) (((unit & 0x7fc) << 5) + (unit & 0x3))
#define MT_BSD (1 <<6) /∗ BSD behavior on close ∗/
/∗ structure for MTIOCTOP − magnetic tape operation command ∗/
struct mtop {
short mt_op; /∗ operation ∗/
daddr_t mt_count; /∗ number of operations ∗/
};
The following operations ofMTIOCTOP ioctl are supported:
MTWEOF write an end-of-file record
MTFSF forward space over file mark
MTBSF backward space over file mark (1/2", 8mm only)
MTFSR forward space to inter-record gap
MTBSR backward space to inter-record gap
MTREW rewind
MTOFFL rewind and take the drive off-line
MTNOP no operation, sets status only
modified 30 Aug 1995 7I-219










