mtio(4)
NAME
mtio − magnetic tape interface
DESCRIPTION
The /dev directory special files, rmt0{l,m,h}, ..., rmt31{l,m,h}, refer to the mass storage tape drives. For both the rewind and norewind special files, described below, the unit number represents a symbolic count that does not have a connection with the actual plug or controller number of a particular tape drive. As each tape unit special file is created, the number counts up from 0 to 31 for a total of 32 tape drives.
The special files, rmt0l, ..., rmt31l are low density, rmt0m, ..., rmt31m are medium density (when a drive is triple density), and rmt0h, ..., rmt31h are high density. All these special files cause a loaded and on-line tape to automatically rewind to the beginning-of-tape (BOT) when closed. Low, medium, and high density are relative to the densities supported on a particular tape drive.
The special files, nrmt0{l,m,h}, ..., nrmt31{l,m,h} do not cause a rewind when closed regardless of density. When closed, the tape is positioned between two tapemarks.
The rmt and nrmt special files discussed above are available to all ULTRIX utilities that can perform I/O to tape. A number of magnetic tape ioctl operations are available and some are used by the above utilities. The operations come under two ioctl request groups. These are MTIOCTOP and MTIOCGET, for tape operation and get status, respectively. See the file <sys/mtio.h> for further information.
Each read or write system call reads or writes the next record on the tape. In the write case the record has the same length as the buffer given. During a read, the record size is passed back as the number of bytes read, provided it is no greater than the buffer size. If the record is long, an error is returned. Seeks are ignored. Positioning is done with a tape ioctl call. A zero byte count is returned when a tape mark is read, but another read will fetch the first record of the next tape file. When a file open for writing is closed, two end-of-files (EOF) are written. If a tape reaches the end-of-tape (EOT) marker, the ENOSPC errno value is set.
FILES
/dev/rmt???
/dev/nrmt???
SEE ALSO
Special Files