Download man Pages(7): Device Network Interfaces

Transcript
mtio ( 7I )
Ioctl Requests
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
daddr_t
daddr_t
u_short
short
};
mt_resid;
mt_fileno;
mt_blkno;
mt_flags;
mt_bf;
/∗ residual count ∗/
/∗ file number of current position ∗/
/∗ block number of current position ∗/
/∗ optimum blocking factor ∗/
/∗ structure for MTIOCGETDRIVETYPE − get tape config data command ∗/
struct mtdrivetype_request {
int
size;
struct
mtdrivetype
∗mtdtp;
};
struct mtdrivetype {
char
name[64];
/∗ Name, for debug ∗/
char
vid[25];
/∗ Vendor id and product id ∗/
char
type;
/∗ Drive type for driver ∗/
int
bsize;
/∗ Block size ∗/
int
int
int
u_char
u_char
u_char
options;
/∗ Drive options ∗/
max_rretries;
/∗ Max read retries ∗/
max_wretries;
/∗ Max write retries ∗/
densities[ MT_NDENSITIES]; /∗ density codes,
low->hi ∗/
default_density; /∗ Default density chosen ∗/
speeds[MT_NSPEEDS]; /∗ speed codes, low->hi ∗/
};
The MTWEOF ioctl is used for writing file marks to tape. Not only does this signify the
end of a file, but also usually has the side effect of flushing all buffers in the tape drive to
the tape medium. A zero count MTWEOF will just flush all the buffers and will not write
any file marks. Because a successful completion of this tape operation will guarantee that
all tape data has been written to the tape medium, it is recommended that this tape
operation be issued before closing a tape device.
7I-246
SunOS 5.6
modified 14 Jan 1997