From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52858 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaUXQ-00044v-3b for qemu-devel@nongnu.org; Wed, 05 Jan 2011 09:40:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaUXP-0007HB-1S for qemu-devel@nongnu.org; Wed, 05 Jan 2011 09:40:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaUXO-0007Gu-Qp for qemu-devel@nongnu.org; Wed, 05 Jan 2011 09:40:30 -0500 Message-ID: <4D2482D6.2030401@redhat.com> Date: Wed, 05 Jan 2011 15:40:22 +0100 From: Jes Sorensen MIME-Version: 1.0 References: <1294224062-18745-1-git-send-email-Jes.Sorensen@redhat.com> <4D247633.80304@codemonkey.ws> In-Reply-To: <4D247633.80304@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Make strtosz() return int64_t instead of ssize_t List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: agraf@suse.de, qemu-devel@nongnu.org, armbru@redhat.com On 01/05/11 14:46, Anthony Liguori wrote: > On 01/05/2011 04:41 AM, Jes.Sorensen@redhat.com wrote: >> From: Jes Sorensen >> >> strtosz() needs to return a 64 bit type even on 32 bit >> architectures. Otherwise qemu-img will fail to create disk >> images>= 2GB >> >> Signed-off-by: Jes Sorensen >> > > off_t would be the proper type to use. I discussed this with Markus, and we both agree that it isn't. Two reasons, off_t is for filesystem offsets, not random sizes. Second, off_t doesn't have an unsigned type or a max to compare against. Using int64_t is cleaner and safer. Cheers, Jes