Annotation of cci/usr/src/man/man4/mt.4, revision 1.1.1.1

1.1       root        1: .TH MT 4 4/1/81
                      2: .SH NAME
                      3: mt \- UNIX magtape interface
                      4: .SH DESCRIPTION
                      5: The files
                      6: .I "cy0s, ..., cy15s"
                      7: refer to the UNIX magtape drives,
                      8: which may be on the VERSABUS using the CIPHER tapemaster formatter
                      9: .IR cy (4),
                     10: The following description applies to any of the transport/controller pairs.
                     11: The files
                     12: .I "cy0s, ..., cy15s"
                     13: are read/written in 25ips, 
                     14: The density (1600 bpi or 3200 bpi) is selected by a switch on the drive.
                     15: The files
                     16: .I "cy0s, ..., cy7s"
                     17: are rewound when closed.
                     18: The non-rewinding files are named
                     19: .I ncy[0-7]
                     20: respectively.
                     21: .PP
                     22: For compatibility, the
                     23: .I [n]cy*s
                     24: files are linked to appropriate
                     25: .I [n]mt*
                     26: files.
                     27: .PP
                     28: When a file open for writing is closed, two file-marks are written.
                     29: If the tape is not to be rewound
                     30: it is positioned with the head between the two
                     31: file-marks.
                     32: .PP
                     33: A standard tape consists of a
                     34: series of 1024 byte records terminated by two
                     35: file-marks.
                     36: To the extent possible, the system makes
                     37: it possible, if inefficient, to treat
                     38: the tape like any other file.
                     39: Seeks have their usual meaning and it is possible
                     40: to read or write a byte at a time.
                     41: .PP
                     42: The
                     43: .I mt
                     44: files discussed above are useful
                     45: when it is desired to access the tape in a way
                     46: compatible with ordinary files.
                     47: When foreign tapes are to be dealt with, and especially
                     48: when long records are to be read or written, the
                     49: `raw' interface is appropriate.
                     50: Writing in very small units is inadvisable,
                     51: however, because it tends to create monstrous record
                     52: gaps.  The associated files are named
                     53: .I "rcy0s, ..., rcy15s,"
                     54: but the same minor-device considerations as for the regular files still apply,
                     55: as well as the appropriate
                     56: .I r[n]mt*
                     57: links.
                     58: .PP
                     59: A number of other ioctl operations are available
                     60: on raw magnetic tape.
                     61: The following definitions are from <sys/mtio.h>:
                     62: .PP
                     63: .nf
                     64: /*
                     65:  * Structures and definitions for mag tape io control commands
                     66:  */
                     67: 
                     68: /* mag tape io control commands */
                     69: #define MTIOCTOP       (('m'<<8)|1)    /* do a mag tape op */
                     70: #define MTIOCGET       (('m'<<8)|2)    /* get mag tape status */
                     71: 
                     72: /* structure for MTIOCTOP - mag tape op command */
                     73: struct mtop    {
                     74:        short   mt_op;          /* operations defined below */
                     75:        daddr_t mt_count;       /* how many of them */
                     76: };
                     77: 
                     78: /* operations */
                     79: #define MTWEOF 0       /* write an end-of-file record */
                     80: #define MTFSF  1       /* forward space file */
                     81: #define MTBSF  2       /* backward space file */
                     82: #define MTFSR  3       /* forward space record */
                     83: #define MTBSR  4       /* backward space record */
                     84: #define MTREW  5       /* rewind */
                     85: #define MTOFFL 6       /* rewind and put the drive offline */
                     86: #define MTNOP  7       /* no operation, sets status only */
                     87: 
                     88: /* structure for MTIOCGET - mag tape get status command */
                     89: 
                     90: struct mtget   {
                     91:        short   mt_type;                /* type of magtape device */
                     92: /* the following two registers are grossly device dependent */
                     93:        short   mt_dsreg;               /* ``drive status'' register */
                     94:        short   mt_erreg;               /* ``error'' register */
                     95: /* end device-dependent registers */
                     96:        short   mt_resid;               /* residual count */
                     97: /* the following two are not yet implemented */
                     98:        daddr_t mt_fileno;      /* file number of current position */
                     99:        daddr_t mt_blkno;       /* block number of current position */
                    100: /* end not yet implemented */
                    101: };
                    102: 
                    103: /*
                    104:  * Constants for mt_type byte
                    105:  */
                    106: #define MT_ISTS                01
                    107: #define MT_ISHT                02
                    108: #define MT_ISTM                03
                    109: .fi
                    110: .ft R
                    111: .PP
                    112: Each
                    113: .I read
                    114: or
                    115: .I write
                    116: call reads or writes the next record on the tape.
                    117: In the write case the record has the same length as the
                    118: buffer given.
                    119: During a read, the record size is passed
                    120: back as the number of bytes read, provided it is no greater
                    121: than the buffer size;
                    122: if the record is long, an error is indicated.
                    123: In raw tape I/O seeks are ignored.
                    124: A zero byte count is returned when a tape mark is read,
                    125: but another read will fetch the first record of the
                    126: new tape file.
                    127: .SH FILES
                    128: /dev/mt?,
                    129: /dev/rmt?
                    130: .SH "SEE ALSO"
                    131: mt(1), tar(1), cy(4)
                    132: .SH BUGS

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.