mt.7 (2010 09)

m
mt(7) mt(7)
long mt_dsreg1; /* status register (msb) */
long mt_dsreg2; /* status register (lsb) */
/* The following are device-independent status words */
long mt_gstat; /* generic status */
long mt_erreg; /* error register */
int32_t mt_fileno; /* No longer used - always set to -1 */
int32_t mt_blkno; /* No longer used - always set to -1 */
Information for decoding the
mt_type field can be found in
<sys/mtio.h>.
Tape operations work the same way for both legacy and agile devices.
Other Tape Status Characteristics
Efficient use of streaming tape drives with large internal buffers and immediate-reporting require the fol-
lowing end-of-tape procedures:
All writes near LEOT (Logical End of Tape) complete without error if actually written to the tape.
Once the tape driver determines that LEOT has been passed, subsequent writes do not occur and an
error message is returned.
To write beyond this point (keep in mind that streaming drives have already written well past
LEOT), simply ask for status using the
MTIOCGET ioctl. If status reflects the EOT condition, the
driver drops all write barriers.
Both the
estape and stape drivers will flush the device buffers when a write filemark (all dev-
ices) or write setmark (devices that support setmarks) command is given with the count set to zero.
When immediate-reporting is disabled, the write encountering LEOT returns an error with the tape
driver automatically backing up over that record.
When reading near the end-of-tape, the user is not informed of LEOT. Instead, the typical double EOF
marks or a pre-arranged data pattern signals the logical end-of-tape.
Since magnetic tape drives vary in EOT sensing due to differences in the physical placement of sensors,
any application (such as multiple-tape cpio (1) backups) requiring that data be continued from the EOT
area of one tape to another tape must be restricted. Therefore, the tape drive type and mode should be
identical for the creation and reading of the tapes.
The following macros are defined in
<sys/mtio.h> for decoding the status field mt_gstat returned from
MTIOCGET. For each macro, the input parameter x is the mt_gstat field.
GMT_BOT(x) Returns TRUE at beginning of tape.
GMT_EOD(x) Returns TRUE if End-of-Data is encountered for DDS, QIC or
8MM.
GMT_EOF(x) Returns TRUE at an End-of-File mark.
GMT_EOT(x) Returns TRUE at end of tape.
GMT_IM_REP_EN(x) Returns TRUE if immediate reporting mode is enabled.
GMT_ONLINE(x) Returns TRUE if drive is online.
GMT_SM(x) Returns TRUE if setmark is encountered.
GMT_WR_PROT(x) Returns TRUE if tape is write protected.
GMT_COMPRESS(x) Returns TRUE if data compression is enabled.
GMT_DENSITY(x) Returns the currently configured 8-bit density value. Supported
values are defined in <sys/mtio.h>.
GMT_D_800(x) Returns TRUE if the density encoded in mt_gstat is 800 bpi.
GMT_D_1600(x) Returns TRUE if the density encoded in mt_gstat is 1600
bpi.
GMT_D_6250(x) Returns TRUE if the density encoded in mt_gstat is 6250 bpi
(with or without compression).
GMT_D_6250c(x) Returns TRUE if the density encoded in mt_gstat is 6250 bpi
plus compression.
HP-UX 11i Version 3: September 2010 7 Hewlett-Packard Company 7