Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Nov 2011 20:31:22 +0000
From:      Alexander Best <arundel@freebsd.org>
To:        Tim Kientzle <tim@kientzle.com>
Cc:        freebsd-hackers@freebsd.org, Juergen Lock <nox@jelal.kn-bremen.de>
Subject:   Re: easy way to determine if a stream or fd is seekable
Message-ID:  <20111118203122.GA9508@freebsd.org>
In-Reply-To: <B06B2304-A1BC-49A3-A811-F05625138D58@kientzle.com>
References:  <20111115202450.GA73512@freebsd.org> <20111116102239.GA2687@britannica.bec.de> <20111116131428.GA40723@freebsd.org> <20111116232152.GC21793@britannica.bec.de> <20111117002438.GA55931@freebsd.org> <201111172055.pAHKtZso061118@triton8.kn-bremen.de> <B06B2304-A1BC-49A3-A811-F05625138D58@kientzle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri Nov 18 11, Tim Kientzle wrote:
> 
> On Nov 17, 2011, at 12:55 PM, Juergen Lock wrote:
> 
> >> 
> >> After a few experiments, bsdtar stopped using lseek() on
> >> FreeBSD for anything other than regular files and block
> >> devices.   I believe there are other things that do support
> >> seeking, but I don't believe there is an accurate mechanism
> >> for determining whether lseek() is correctly supported.
> > 
> > Ah is that the reason why my patch never made it into FreeBSD 9?
> > I'm talking about this thread, where I also commented on seeking
> > on tape:
> > 
> > 	http://docs.freebsd.org/cgi/mid.cgi?20100220101724.GA26604
> > 	(Re: "tar tfv /dev/cd0" speedup patch)
> > 
> > 	entire thread here:
> > 	http://markmail.org/message/nfznipqik3tuhbqp
> > 
> > Cheers,
> > 	Juergen (who would still like to see a faster "tar tfv /dev/cd0"... :)
> 
> I would like to see that as well.
> 
> Take a look at 
> 
> http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_filename.c
> 
> Especially the comments about detecting "disk-like" devices.
> I rewrote a bunch of this code to introduce an explicit
> notion of "strategy" so that we could optimize access
> to a variety of different devices.
> 
> This code has a notion of "disk-like" file descriptors and
> some optimizations for such.  There are some comments
> in there outlining similar optimizations that could be made
> for "tape-like" or "socket-like" devices.

great you posted that file as reference. i believe most of the stuff done there
should actually be done within lseek(). if userspace applications have to
determine between file types they're operating on we're back to in the pre-unix
days. ;)

cheers.
alex

maybe support for block special files could completely be dropped, since
freebsd seems to have entirely switched to character special files?

> 
> Cheers,
> 
> Tim
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111118203122.GA9508>