I/O requests must be in length a multiple of the tape block length if the tape drive is in fixed-block mode. The default value for tape block length is whatever block length the tape hardware defaults to when it is powered on. I/O requests may be variable in length if the tape drive is set to variable block mode. See tapecntl(ADM) for details on setting the mode and block size of the tape drive. It is the responsibility of the user to ensure that the tape drive is set to the appropriate block size and fixed or variable block mode before attempting I/O to the tape device.
Only raw character interface files are provided. When opened, the tape is assumed to be positioned as desired. If a retension-on-open special file is opened, the tape is retensioned before any I/O is performed. When a T_RWD, T_RETENSION, T_LOAD, or T_UNLOAD ioctl is requested and the tape has been written, two file marks are written before the ioctl is executed.
The open(S) on a tape device will fail if a tape is not inserted, resulting in the error report EIO. An open(S) can also fail if the tape controller associated with the special file is not detected by the driver. In this case, the error reported is ENXIO.
The following table lists the actions that occur on close, depending on whether the file is designated as rewind or no-rewind, and if the tape was written or read:
Rewind on | Tape | Tape | Action on |
---|---|---|---|
Close? | Read? | Written? | Close |
Yes | Yes | N/A | Rewind tape |
Yes | N/A | Yes | Write two file marks and rewind tape |
Yes | No | No | Rewind tape |
No | No | No | No tape movement |
No | Yes | N/A | Position tape after next file mark |
No | N/A | Yes | Write one file mark and position tape after this file mark |
A read occurring when the tape is positioned immediately before a file mark returns zero bytes, and the tape is positioned after the file mark. As with other raw devices, seeks are ignored. Some tape devices allow both reads and writes to occur between rewinds; the st01 driver supports these devices.
Tape Special File | Action |
---|---|
| |
/dev/rmt/cCbBtTlL | Rewind tape on close |
/dev/rmt/ctapeU | |
/dev/rmt/cUs0 | |
/dev/rctU | |
/dev/rStpU | |
/dev/xctU | |
/dev/xStpU | |
/dev/rmt/cCbBtTlLn | Don't rewind tape on close |
/dev/rmt/ntapeU | |
/dev/rmt/cUs0n | |
/dev/nrctU | |
/dev/nrStpU | |
/dev/rmt/cCbBtTlLr | Retension tape on open |
/dev/rmt/rtapeU | and rewind tape on close |
/dev/rmt/cUs0r | |
/dev/erctU | |
/dev/rmt/cCbBtTlLnr | Retension tape on open |
/dev/rmt/nrtapeU | and don't rewind tape on close |
/dev/rmt/cUs0nr | |
/dev/rmt/cCbBtTlLu | Unload tape on close |
/dev/rmt/utapeU |