kvt@drutx.ATT.COM (TranKV) (03/25/88)
To all UNIX/C gurus out there: When using read(2)/write(2) 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? All suggestions are appreciated. Kim Tran AT&T EUO
kvt@drutx.ATT.COM (TranKV) (03/25/88)
In article <7043@drutx.ATT.COM>, kvt@drutx.ATT.COM (TranKV) writes: > To all UNIX/C gurus out there: > > When using read(2)/write(2) 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? All suggestions are appreciated. > > Kim Tran > AT&T EUO > To add more spices to the discussion, I should have thrown in some evidences in the first posting. Here they are: - 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