Technical data

mtio(7I) Ioctl Requests SunOS 5.5
MTRETEN retension the tape (cartridge tape only)
MTERASE erase the entire tape and rewind
MTEOM position to EOM
MTNBSF
backward space file to beginning of file
MTSRSZ set record size
MTGRSZ get record size
MTLOAD load the next tape cartridge into the tape drive.
/structure for MTIOCGET magnetic tape get status command /
struct mtget {
short mt_type; /type of magtape device /
/the following two registers are device dependent /
short mt_dsreg; /“drive status” register /
short mt_erreg; /“error” register /
/optional error info. /
daddr_t mt_resid; /residual count /
daddr_t mt_fileno; /file number of current position /
daddr_t mt_blkno; /block number of current position /
u_short mt_flags;
short mt_bf; /optimum blocking factor /
};
When spacing forward over a record (either data or EOF), the tape head is positioned in
the tape gap betweenthe record just skipped and the next record. When spacing forward
over file marks (EOF records), the tape head is positioned in the tape gap between the
nextEOF record and the record that follows it.
When spacing backward over a record (either data or EOF), the tape head is positioned in
the tape gap immediately preceding the tape record where the tape head is currently
positioned. When spacing backward over file marks (EOF records), the tape head is posi-
tioned in the tape gap preceding theEOF. Thus the next read would fetch the EOF.
Record skipping does not go past a file mark; file skipping does not go past theEOM.
After an MTFSR <huge number> command the driver leaves the tape logically positioned
before theEOF. A related feature is that EOFs remain pending until the tape is closed. For
example, a program which first reads all the records of a file up to and including the EOF
and then performs an MTFSF command will leave the tape positioned just after that same
EOF, rather than skippingthe next file.
The MTNBSF andMTFSF operations are inverses. Thus, an “MTFSF 1” is equivalent to
an “MTNBSF 1”. An “MTNBSF 0” is the same as “MTFSF 0”; both position the tape device
at the beginning of the current file.
MTBSF moves the tape backwards by file marks. The tape position will end on the begin-
ning of tape side of the desired file mark.
7I-220 modified 30 Aug 1995