read(2)/write(2) errno for end of 9-track tapes

TranKV kvt at drutx.ATT.COM
Fri Mar 25 09:31:33 AEST 1988


When read(2)/write(2) are used to access a physical device in raw mode
(9-track tape devices specifically), are there a standard errno's that 
read(2)/write(2) returns to signify end of physical tapes? Or do they 
vary among UNIX versions and tape drives? If they are indeed different,
what one can do in application programs to make them portable when
changing tape drives or machines? 

To add more spices to the discussion, here are some interesting 
phenomenon:

    - Using our 3B5 with UNIX V 2.0, we got errno=5 for both end of
      tape read(2) and write(2).

    - Using our 3B2/600 with UNIX V 3.1 with 9-track tape drive hooked
      up through SCSI, we got errno=28 for end of tape write(2) and
      errno=0 for end of tape read(2).

    - We wrote a small C program to write(2) 5120 bytes at a time 
      to a 9-track tape on the 3B5 (using raw mode) until we got to 
      the end of tape. Then we tried to read(2) the tape (5120 bytes
      at a time) on the 3B2. To our surprise, 3B2 can read more than
      the 3B5 wrote and the 3B2 cannot detect end of tape without
      giving error warning. Reverse the read/write order, the 3B5 
      seems read less than what was put on tape by the 3B2.

So we're confused. And help is definitely needed.

Kim Tran
AT&T EUO



More information about the Comp.unix.wizards mailing list