From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 20 06:01:05 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 260E9106566C; Sat, 20 Feb 2010 06:01:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-hackers@freebsd.org Date: Sat, 20 Feb 2010 01:00:40 -0500 User-Agent: KMail/1.6.2 References: <20100217215940.GA19713@triton8.kn-bremen.de> <20100219181247.GA35702@triton8.kn-bremen.de> <4B7F711E.6040402@freebsd.org> In-Reply-To: <4B7F711E.6040402@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002200100.48161.jkim@FreeBSD.org> Cc: Garrett Cooper , Tim Kientzle , Juergen Lock Subject: Re: "tar tfv /dev/cd0" speedup patch 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: Sat, 20 Feb 2010 06:01:05 -0000 On Saturday 20 February 2010 12:20 am, Tim Kientzle wrote: > Juergen, > > I was looking at your Linux code here and thought > the technique of trying lseek(SEEK_END) might work. > Unfortunately, it doesn't: lseek(fd, 0, SEEK_END) gives > zero for both /dev/sa0 (a tape drive) and /dev/cd0 > (an optical drive). Are you sure it works on Linux? Can you please try ioctl(fd, BLKGETSIZE64, &some_uint64_var) or ioctl(fd, BLKGETSIZE, &some_u_long_var)? Jung-uk Kim