[PATCH] fadvise(2) system call

Tim Kientzle tim at kientzle.com
Sat Nov 12 00:08:43 UTC 2011


On Nov 9, 2011, at 10:46 PM, Warner Losh 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.

Yes, seek(2) is badly broken on tape drives.  It does nothing and doesn't return an error (unlike seek(2) on pipes, which does return an error).

I've seen references to ioctls that are supported by some drivers and/or hardware that allow skipping forward by some number of records.  But I don't know the details.

I doubt it's a major performance optimization in most cases, but it would still be nice to avoid copying the data all the way down just to ignore it.

Tim



More information about the freebsd-arch mailing list