mt.7 (2010 09)

m
mt(7) mt(7)
#include <sys/types.h>
#include <sys/mtio.h>
struct mtop mtop;
mtop.mt_op = MTFSS;
mtop.mt_count = 1;
ioctl(fd, MTIOCTOP, &mtop);
Given that fd is a valid file descriptor for an opened tape device, and that it has just returned 0 from a
read(2) request. The following system call verifies that the tape has just read a filemark:
#include <sys/types.h>
#include <sys/mtio.h>
struct mtget mtget;
ioctl(fd, MTIOCGET, &mtget);
if (GMT_EOF (mtget.mt_gstat)) {
/* code for filemark detection */
}
WARNINGS
Density specification BEST (standard naming convention) activate data compression on tape devices
which support compression. This is also true for the files using the pre-HP-UX 10.0 naming convention
which are linked to these files (see "Naming Conventions" above).
For the persistent tape DSFs the minor number does not encode any configuration option. The minor
number represents an index into a persistent kernel database where the configuration options are stored.
It is recommended that all legacy tape device files be put in the
/dev/rmt directory. Legacy Device files
using extended configuration options located outside the /dev/rmt directory may not provide consistent
behavior across system reboots.
Although persistent DSFs may be created in directories other than
/dev/rtape, HP recommends that
persistent tape DSFs only be created in /dev/rtape.
Use the rmsf (1M) command to clean up unused device files. Otherwise, the property table may overflow
and cause the mksf(1M) command to fail.
Density codes listed in
<sys/mtio.h> have device-dependent behaviors. See the hardware manual for
your tape device to find which densities are valid. For some devices, these values may be referred to as
formats instead of densities.
Use of unbuffered mode can reduce performance and increase media wear.
DEPENDENCIES
Driver-Specific Options for stape (Major Number 205)
The following options may be used in creating legacy DSFs for tape drives that access the
stape driver:
e Exhaustive mode is enabled (default is disabled).
When exhaustive mode is enabled, the driver will, if necessary, attempt several different
configuration options when opening a device. The first attempt follows the minor number
configuration exactly, but if that fails, the driver attempts other likely configuration values.
With Exhaustive mode disabled, the driver makes only one attempt to configure a device using
the configuration indicated in the minor number.
p Specifies a partitioned tape whose currently active partition is partition 1 (closest to BOT (begin-
ning of tape)). Optional partition 1 is closest to BOT for possible use as a volume directory. The
default partition without this option is partition 0. If partitioning is unsupported, the entire tape
is referred to as partition 0.
s[#] Specifies fixed-block mode; the optional number indicates the block size. If the number is not
present, the driver selects a default block size appropriate to the device type.
HP-UX 11i Version 3: September 2010 9 Hewlett-Packard Company 9