From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 18 22:11:22 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50B2E106564A; Fri, 18 Nov 2011 22:11:22 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 078068FC08; Fri, 18 Nov 2011 22:11:21 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 04EB01E000C2; Fri, 18 Nov 2011 23:11:19 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id pAIMAC2t000372; Fri, 18 Nov 2011 23:10:12 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id pAIMABsg000371; Fri, 18 Nov 2011 23:10:11 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Fri, 18 Nov 2011 23:10:11 +0100 To: Tim Kientzle Message-ID: <20111118221011.GA99985@triton8.kn-bremen.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Fri, 18 Nov 2011 22:16:07 +0000 Cc: Alexander Best , Juergen Lock , freebsd-hackers@freebsd.org Subject: Re: easy way to determine if a stream or fd is seekable X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 22:11:22 -0000 On Fri, Nov 18, 2011 at 12:00:07PM -0800, 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. Ah so it's `just' a slow release cycle? % grep DIOCGMEDIASIZE /home/ncvs/src/lib/libarchive/archive_read_open_filename.c,v % When will we see this code in FreeBSD? 10.0? 9.1? 8.3? :) Curious... Juergen