From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S13wS-0001jC-IT for qemu-devel@nongnu.org; Fri, 24 Feb 2012 17:48:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S13wP-0002V0-VA for qemu-devel@nongnu.org; Fri, 24 Feb 2012 17:48:44 -0500 Received: from ozlabs.org ([203.10.76.45]:48734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S13wP-0002Um-JS for qemu-devel@nongnu.org; Fri, 24 Feb 2012 17:48:41 -0500 Date: Sat, 25 Feb 2012 09:08:54 +1100 From: David Gibson Message-ID: <20120224220854.GA3433@truffala.fritz.box> References: <1330043806-31899-1-git-send-email-david@gibson.dropbear.id.au> <1330043806-31899-3-git-send-email-david@gibson.dropbear.id.au> <4F475547.1020102@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4F475547.1020102@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] Allow larger return values from get_image_size() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws On Fri, Feb 24, 2012 at 10:15:51AM +0100, Andreas F=E4rber wrote: > Am 24.02.2012 01:36, schrieb David Gibson: > > Currently get_image_size(), used to find the size of files, returns a= n int. > > But for modern systems, int may be only 32-bit and we can have files > > larger than that. > >=20 > > This patch, therefore, changes the return type of get_image_size() to= off_t > > (the same as the return type from lseek() itself). It also audits al= l the > > callers of get_image_size() to make sure they process the new unsigne= d > > return type correctly. >=20 > It's a size, so why off_t and not size_t? Because it's a file size, rather than an in-memory size. Or more specifically, off_t is the return type of lseek() which is where the information is coming from in the first place. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other= _ | _way_ _around_! http://www.ozlabs.org/~dgibson