add lint
[unix-history] / usr / src / old / man / mtop.4
CommitLineData
6d5259d5
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)mtop.4 4.1 (Berkeley) %G%
6.\"
7.TH MTOP 4 10/8/81
8.UC 4
9.SH NAME
10mt \- UNIX magtape interface
11.SH DESCRIPTION
12The files
13.I "mt0, ..., mt15"
14refer to the UNIX magtape drives,
15which may be on the MASSBUS using the TM03 or TM78 formatters
16.IR ht (4)
17or
18.IR mt (4),
19or on the UNIBUS using either the TM11, TS11, or TU45 formatters
20.IR tm (4),
21.IR ts (4)
22or
23.IR ut (4).
24The following description applies to any of the transport/controller pairs.
25The files
26.I "mt0, ..., mt7"
27are low density, and
28.I "mt8, ..., mt15"
29are high density.
30On the TM03 and TM11 low density is 800bpi and high density is 1600bpi.
31On the TM78 low density is 1600bpi and high density is 6250bpi.
32On the TS11 both low and high density are 1600bpi.
33The files
34.I "mt0, ..., mt3"
35and
36.I "mt8, ..., mt11"
37are rewound when closed; the others are not.
38When a file open for writing is closed, two end-of-files are written.
39If the tape is not to be rewound
40it is positioned with the head between the two
41tapemarks.
42.PP
43A standard tape consists of a
44series of 1024 byte records terminated by an
45end-of-file.
46To the extent possible, the system makes
47it possible, if inefficient, to treat
48the tape like any other file.
49Seeks have their usual meaning and it is possible
50to read or write a byte at a time.
51Writing in very small units is inadvisable,
52however, because it tends to create monstrous record
53gaps.
54.PP
55The
56.I mt
57files discussed above are useful
58when it is desired to access the tape in a way
59compatible with ordinary files.
60When foreign tapes are to be dealt with, and especially
61when long records are to be read or written, the
62`raw' interface is appropriate.
63The associated files are named
64.I "rmt0, ..., rmt15,"
65but the same minor-device considerations as for the regular files still apply.
66A number of other ioctl operations are available
67on raw magnetic tape.
68The following definitions are from <sys/mtio.h>:
69.PP
70.nf
71/*
72 * Structures and definitions for mag tape io control commands
73 */
74
75/* mag tape io control commands */
76#define MTIOCTOP (('m'<<8)|1) /* do a mag tape op */
77#define MTIOCGET (('m'<<8)|2) /* get mag tape status */
78
79/* structure for MTIOCTOP - mag tape op command */
80struct mtop {
81 short mt_op; /* operations defined below */
82 daddr_t mt_count; /* how many of them */
83};
84
85/* operations */
86#define MTWEOF 0 /* write an end-of-file record */
87#define MTFSF 1 /* forward space file */
88#define MTBSF 2 /* backward space file */
89#define MTFSR 3 /* forward space record */
90#define MTBSR 4 /* backward space record */
91#define MTREW 5 /* rewind */
92#define MTOFFL 6 /* rewind and put the drive offline */
93#define MTNOP 7 /* no operation, sets status only */
94
95/* structure for MTIOCGET - mag tape get status command */
96
97struct mtget {
98 short mt_type; /* type of magtape device */
99/* the following two registers are grossly device dependent */
100 short mt_dsreg; /* ``drive status'' register */
101 short mt_erreg; /* ``error'' register */
102/* end device-dependent registers */
103 short mt_resid; /* residual count */
104/* the following two are not yet implemented */
105 daddr_t mt_fileno; /* file number of current position */
106 daddr_t mt_blkno; /* block number of current position */
107/* end not yet implemented */
108};
109
110/*
111 * Constants for mt_type byte
112 */
113#define MT_ISTS 01
114#define MT_ISHT 02
115#define MT_ISTM 03
116#define MT_ISMT 04
117#define MT_ISUT 05
118.fi
119.ft R
120.PP
121Each
122.I read
123or
124.I write
125call reads or writes the next record on the tape.
126In the write case the record has the same length as the
127buffer given.
128During a read, the record size is passed
129back as the number of bytes read, provided it is no greater
130than the buffer size;
131if the record is long, an error is indicated.
132In raw tape I/O seeks are ignored.
133A zero byte count is returned when a tape mark is read,
134but another read will fetch the first record of the
135new tape file.
136.SH FILES
137/dev/mt?,
138/dev/rmt?
139.SH "SEE ALSO"
140mt(1), tar(1), tp(1), ht(4), mt(4), tm(4), ts(4)
141.SH BUGS