[PATCH] fadvise(2) system call

Warner Losh imp at bsdimp.com
Thu Nov 10 16:29:16 UTC 2011


On Nov 10, 2011, at 9:09 AM, perryh at pluto.rain.com wrote:

> Warner Losh <imp at bsdimp.com> wrote:
>> On Nov 9, 2011, at 11:03 PM, Tim Kientzle wrote:
>>> Anyone know how to properly request a "skip forward"
>>> on tape drives?  That's one of the missing pieces.
>> 
>> I thought that you couldn't seek(2) on tape drives.  You must
>> read(2) the data.  At least for this application, since a tar file
>> would be just one file on the tape.  If you want to see to the
>> next file mark, you need to use an ioctl to get there, or read a
>> lot.
> 
> AFAIK you can't seek(2) backward unless using something along the
> lines of a DECtape (remember those?), but there's no reason in
> principle why a forward seek(2) could not be implemented in the
> driver -- even without any help from the hardware.  It would save
> some DMA, interrupt, and context-switch traffic, but even when
> searching for a filemark the drive won't move the tape any faster
> than when reading.

Seek(2) never makes it down to the driver for character devices.  Character devices have no position.

VMS did implement forward and reverse seeking on at least mag tapes.

Warner



More information about the freebsd-arch mailing list