81 issued. If this ioctl succeeds, then persistent error handling is
82 enabled and changes the current error behavior. This ioctl will fail if
83 the device driver does not support persistent error handling.
84
85 With persistent error handling enabled, all tape operations after an
86 exception or error will return with the same error as the first command
87 that failed; the operations will not be executed. An exception is some
88 event that might stop normal tape operations, such as an End Of File
89 (EOF) mark or an End Of Tape (EOT) mark. An example of an error is a
90 media error. The MTIOCLRERR ioctl must be issued to allow normal tape
91 operations to continue and to clear the error.
92
93 Disabling persistent error handling returns the error behavior to normal
94 SVR4 error handling, and will not occur until all outstanding operations
95 are completed. Applications should wait for all outstanding operations
96 to complete before disabling persistent error handling. Closing the
97 device will also disable persistent error handling and clear any errors
98 or exceptions.
99
100 The Read Operation and Write Operation subsections contain more pertinent
101 information reguarding persistent error handling.
102
103 Read Operation
104 The read(2) function reads the next record on the tape. The record size
105 is passed back as the number of bytes read, provided it is not greater
106 than the number requested. When a tape mark or end of data is read, a
107 zero byte count is returned; all successive reads after the zero read
108 will return an error and errno will be set to EIO. To move to the next
109 file, an MTFSF ioctl can be issued before or after the read causing the
110 error. This error handling behavior is different from the older BSD
111 behavior, where another read will fetch the first record of the next tape
112 file. If the BSD behavior is required, device names containing the
113 letter `b' (for BSD behavior) in the final component should be used. If
114 persistent error handling was enabled with either the BSD or SVR4 tape
115 device behavior, all operations after this read error will return EIO
116 errors until the MTIOCLRERR ioctl is issued. An MTFSF ioctl can then he
117 issued.
118
119 Two successful successive reads that both return zero byte counts
120 indicate EOM on the tape. No further reading should be performed past
121 the EOM.
122
123 Fixed-length I/O tape devices require the number of bytes read to be a
124 multiple of the physical record size. For example, 1/4" cartridge tape
125 devices only read multiples of 512 bytes. If the blocking factor is
126 greater than 64,512 bytes (minphys limit), fixed-length I/O tape devices
127 read multiple records.
128
129 Most tape devices which support variable-length I/O operations may read a
130 range of 1 to 65,535 bytes. If the record size exceeds 65,535 bytes, the
131 driver reads multiple records to satisfy the request. These multiple
132 records are limited to 65,534 bytes. Newer variable-length tape drivers
133 may relax the above limitation and allow applications to read record
134 sizes larger than 65,534. Refer to the specific tape driver man page for
135 details.
136
645
646 The MTIOCREADIGNOREILI ioctl enables or disables the suppress incorrect
647 length indicator (SILI) support during reads. As an argument, it takes a
648 pointer to an integer. If 0 (zero) is the specified integer, SILI will
649 not be used during reads and incorrect length indicator will not be
650 suppressed. If 1 is the specified integer, SILI will be used during
651 reads and incorrect length indicator will be suppressed. The specified
652 tape behavior will be in effect until the device is closed.
653
654 For example:
655
656 int on = 1;
657 int off = 0;
658 ioctl(fd, MTIOREADIGNOREILI, &on);
659 ioctl(fd, MTIOREADIGNOREILI, &off);
660
661 The MTIOCREADIGNOREEOFS ioctl enables or disables support for reading
662 past double EOF marks which otherwise indicate End-Of-recorded-media
663 (EOM) in the case of 1/2" reel tape drives. As an argument, it takes a
664 pointer to an integer. If 0 (zero) is the specified integer, then double
665 EOF marks indicate End-Of-recodred-media (EOD). If 1 is the specified
666 integer, the double EOF marks no longer indicate EOM, thus allowing
667 applications to read past two EOF marks. In this case it is the
668 responsibility of the application to detect end-of-recorded-media (EOM).
669 The specified tape behavior will be in effect until the device is closed.
670
671 For example:
672
673 int on = 1;
674 int off = 0;
675 ioctl(fd, MTIOREADIGNOREEOFS, &on);
676 ioctl(fd, MTIOREADIGNOREEOFS, &off);
677
678 Tape drives other than 1/2" reel tapes will return an errno of ENOTTY.
679
680 FILES
681 /dev/rmt/<unit number><density>[<BSD behavior>][<no rewind>]
682
683 Where <density> can be `l', `m', `h', `u/c' (low, medium, high,
684 ultra/compressed, respectively), the <BSD behavior> option is `b, and
685 the' <no rewind> option is `n'.
715
716 mt_command.mt_op = MTNBSF;
717 mt_command.mt_count = 2;
718 ioctl(fd, MTIOCTOP, &mt_command);
719 ioctl(fd, MTIOCGET, (char *)&mt_status);
720
721 To get information about the tape drive:
722
723 struct mtdrivetype mtdt;
724 struct mtdrivetype_request mtreq;
725 mtreq.size = sizeof(struct mtdrivetype);
726 mtreq.mtdtp = &mtdt;
727 ioctl(fd, MTIOCGETDRIVETYPE, &mtreq);
728
729 SEE ALSO
730 mt(1), tar(1), dd(1M), open(2), read(2), write(2), aioread(3C),
731 aiowrite(3C), ar.h(3HEAD), st(7D)
732
733 1/4 Inch Tape Drive Tutorial
734
735 illumos August 31, 2018 illumos
|
81 issued. If this ioctl succeeds, then persistent error handling is
82 enabled and changes the current error behavior. This ioctl will fail if
83 the device driver does not support persistent error handling.
84
85 With persistent error handling enabled, all tape operations after an
86 exception or error will return with the same error as the first command
87 that failed; the operations will not be executed. An exception is some
88 event that might stop normal tape operations, such as an End Of File
89 (EOF) mark or an End Of Tape (EOT) mark. An example of an error is a
90 media error. The MTIOCLRERR ioctl must be issued to allow normal tape
91 operations to continue and to clear the error.
92
93 Disabling persistent error handling returns the error behavior to normal
94 SVR4 error handling, and will not occur until all outstanding operations
95 are completed. Applications should wait for all outstanding operations
96 to complete before disabling persistent error handling. Closing the
97 device will also disable persistent error handling and clear any errors
98 or exceptions.
99
100 The Read Operation and Write Operation subsections contain more pertinent
101 information regarding persistent error handling.
102
103 Read Operation
104 The read(2) function reads the next record on the tape. The record size
105 is passed back as the number of bytes read, provided it is not greater
106 than the number requested. When a tape mark or end of data is read, a
107 zero byte count is returned; all successive reads after the zero read
108 will return an error and errno will be set to EIO. To move to the next
109 file, an MTFSF ioctl can be issued before or after the read causing the
110 error. This error handling behavior is different from the older BSD
111 behavior, where another read will fetch the first record of the next tape
112 file. If the BSD behavior is required, device names containing the
113 letter `b' (for BSD behavior) in the final component should be used. If
114 persistent error handling was enabled with either the BSD or SVR4 tape
115 device behavior, all operations after this read error will return EIO
116 errors until the MTIOCLRERR ioctl is issued. An MTFSF ioctl can then be
117 issued.
118
119 Two successful successive reads that both return zero byte counts
120 indicate EOM on the tape. No further reading should be performed past
121 the EOM.
122
123 Fixed-length I/O tape devices require the number of bytes read to be a
124 multiple of the physical record size. For example, 1/4" cartridge tape
125 devices only read multiples of 512 bytes. If the blocking factor is
126 greater than 64,512 bytes (minphys limit), fixed-length I/O tape devices
127 read multiple records.
128
129 Most tape devices which support variable-length I/O operations may read a
130 range of 1 to 65,535 bytes. If the record size exceeds 65,535 bytes, the
131 driver reads multiple records to satisfy the request. These multiple
132 records are limited to 65,534 bytes. Newer variable-length tape drivers
133 may relax the above limitation and allow applications to read record
134 sizes larger than 65,534. Refer to the specific tape driver man page for
135 details.
136
645
646 The MTIOCREADIGNOREILI ioctl enables or disables the suppress incorrect
647 length indicator (SILI) support during reads. As an argument, it takes a
648 pointer to an integer. If 0 (zero) is the specified integer, SILI will
649 not be used during reads and incorrect length indicator will not be
650 suppressed. If 1 is the specified integer, SILI will be used during
651 reads and incorrect length indicator will be suppressed. The specified
652 tape behavior will be in effect until the device is closed.
653
654 For example:
655
656 int on = 1;
657 int off = 0;
658 ioctl(fd, MTIOREADIGNOREILI, &on);
659 ioctl(fd, MTIOREADIGNOREILI, &off);
660
661 The MTIOCREADIGNOREEOFS ioctl enables or disables support for reading
662 past double EOF marks which otherwise indicate End-Of-recorded-media
663 (EOM) in the case of 1/2" reel tape drives. As an argument, it takes a
664 pointer to an integer. If 0 (zero) is the specified integer, then double
665 EOF marks indicate End-Of-recorded-media (EOD). If 1 is the specified
666 integer, the double EOF marks no longer indicate EOM, thus allowing
667 applications to read past two EOF marks. In this case it is the
668 responsibility of the application to detect end-of-recorded-media (EOM).
669 The specified tape behavior will be in effect until the device is closed.
670
671 For example:
672
673 int on = 1;
674 int off = 0;
675 ioctl(fd, MTIOREADIGNOREEOFS, &on);
676 ioctl(fd, MTIOREADIGNOREEOFS, &off);
677
678 Tape drives other than 1/2" reel tapes will return an errno of ENOTTY.
679
680 FILES
681 /dev/rmt/<unit number><density>[<BSD behavior>][<no rewind>]
682
683 Where <density> can be `l', `m', `h', `u/c' (low, medium, high,
684 ultra/compressed, respectively), the <BSD behavior> option is `b, and
685 the' <no rewind> option is `n'.
715
716 mt_command.mt_op = MTNBSF;
717 mt_command.mt_count = 2;
718 ioctl(fd, MTIOCTOP, &mt_command);
719 ioctl(fd, MTIOCGET, (char *)&mt_status);
720
721 To get information about the tape drive:
722
723 struct mtdrivetype mtdt;
724 struct mtdrivetype_request mtreq;
725 mtreq.size = sizeof(struct mtdrivetype);
726 mtreq.mtdtp = &mtdt;
727 ioctl(fd, MTIOCGETDRIVETYPE, &mtreq);
728
729 SEE ALSO
730 mt(1), tar(1), dd(1M), open(2), read(2), write(2), aioread(3C),
731 aiowrite(3C), ar.h(3HEAD), st(7D)
732
733 1/4 Inch Tape Drive Tutorial
734
735 illumos February 17, 2020 illumos
|