From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 23 22:00:04 2010 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 27BE3106566C; Tue, 23 Feb 2010 22:00:04 +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 D33BA8FC17; Tue, 23 Feb 2010 22:00:03 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id BF1DD1E00127; Tue, 23 Feb 2010 23:00:02 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o1NLoAcc067801; Tue, 23 Feb 2010 22:50:10 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o1NLoAks067800; Tue, 23 Feb 2010 22:50:10 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Tue, 23 Feb 2010 22:50:10 +0100 To: freebsd-emulation@FreeBSD.org Message-ID: <20100223215010.GA67619@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Tue, 23 Feb 2010 22:36:37 +0000 Cc: freebsd-hackers@FreeBSD.org, Tim Kientzle Subject: Linuxolator patches: stat and lseek SEEK_END for disk devices 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: Tue, 23 Feb 2010 22:00:04 -0000 Hi! Before this gets buried on -hackers in another thead... :) I now have disks appear as block devices for Linux processes (there already was commented out code for that in linux_stats.c, I hope my version is now `correct enough' to be usable [1]), and I made a simple patch to make lseek SEEK_END (L_XTND in the source) dtrt on disk devices too by simply invoking the DIOCGMEDIASIZE ioctl there; [2] both of these things are what (some) Linux processes expect. Patches are here: (made on stable/8, if they don't apply on head I'll have to make extra versions for that...) http://people.freebsd.org/~nox/linuxdisk-blk.patch [1] http://people.freebsd.org/~nox/lseek-seek_end.patch [2] And yes, with these patches the Linux bsdtar mentioned on -hackers in the `"tar tfv /dev/cd0" speedup patch' thread now also runs fast on FreeBSD. :) Cheers, Juergen