[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] Allow larger return values from get_image_s
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] Allow larger return values from get_image_size() |
Date: |
Sat, 25 Feb 2012 09:08:54 +1100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Feb 24, 2012 at 10:15:51AM +0100, Andreas Färber wrote:
> Am 24.02.2012 01:36, schrieb David Gibson:
> > Currently get_image_size(), used to find the size of files, returns an int.
> > But for modern systems, int may be only 32-bit and we can have files
> > larger than that.
> >
> > 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 all the
> > callers of get_image_size() to make sure they process the new unsigned
> > return type correctly.
>
> 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.
--
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