From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 18 20:00:09 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 A3E751065670; Fri, 18 Nov 2011 20:00:09 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 69A798FC0C; Fri, 18 Nov 2011 20:00:09 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id pAIK086s066483; Fri, 18 Nov 2011 20:00:08 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.119] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id zk83czsjfxjswn2m2wcs2j5xdn; Fri, 18 Nov 2011 20:00:08 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <201111172055.pAHKtZso061118@triton8.kn-bremen.de> Date: Fri, 18 Nov 2011 12:00:07 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: 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> To: Juergen Lock X-Mailer: Apple Mail (2.1251.1) Cc: Alexander Best , 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 20:00:09 -0000 On Nov 17, 2011, at 12:55 PM, Juergen Lock wrote: >>=20 >> 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. >=20 > 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: >=20 > http://docs.freebsd.org/cgi/mid.cgi?20100220101724.GA26604 > (Re: "tar tfv /dev/cd0" speedup patch) >=20 > entire thread here: > http://markmail.org/message/nfznipqik3tuhbqp >=20 > 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=20 = http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_fi= lename.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. Cheers, Tim