write(2) to tape with odd byte count

Griff Smith ggs at ulysses.UUCP
Fri Dec 6 01:26:24 AEST 1985


> > Is it possible to create a tape with an odd number of bytes
> > per record?  When I try such an operation with write(2), I
> > get a return code of -1 (Oh, sorry, this is 2.8BSD).  When I
> > do an identical write to a disk file, there is no problem.
> > Do tape controllers only work in words?
> 
> Actually, raw disk I/O is much worse but that's beside the point.
> 
> Magtapes can be written with any number of bytes between about
> 14 and 2K (often up to 64K-1) per record (block).  However, some
> brain-damaged operating systems maintain the transfer count
> internally as PDP-11 words, instead of bytes.  On such systems,
> you can only request an even number of bytes...

Oh, you're talking about the System V VAX TU78 driver maybe?  It
doesn't give you the error return, it quitely pads to the nearest
"word" so your copy tape isn't really a duplicate of the original.

The 4.2BSD TU78 driver works with any byte count <= 63k.  The 4.3BSD
driver will also do "read-reverse" error correction for soft tape
errors, recognize end of tape (finally), report hardware failures in
human readable form and survive controller power failures without
crashing the system or hanging the tape drives (except on 11/750,
which gets "panic: cbhung" after a while).
-- 

Griff Smith	AT&T (Bell Laboratories), Murray Hill
Phone:		(201) 582-7736
Internet:	ggs at ulysses.uucp
UUCP:		ulysses!ggs  ( {allegra|ihnp4}!ulysses!ggs )



More information about the Comp.unix mailing list