info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Info-mtools] mtools-4.0.17, big disks, 64bit off_t


From: Alain Knaff
Subject: Re: [Info-mtools] mtools-4.0.17, big disks, 64bit off_t
Date: Wed, 08 Aug 2012 16:10:51 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Hi,

On 08/08/2012 01:44 PM, address@hidden wrote:
> Hello,
> 
> mtools-(at least)4.0.17 tries hard to configure and conditionally set types
> to use 64bit file offsets where available for seek()ing etc. However, the
> easy case (sizeof(off_t)>4) is handled incorrectly: mt_size_t is set to
> size_t - maybe a copy and paste from the fall-back-to-32bit case.
> 
> This type is used at least in init.c, when detecting media size and comparing
> to the FAT geometry, consequently failing and erroring out with the message
> "Big disks not supported on this architecture."
> 
> The patch does handle the (e.g. NetBSD since 1994) case of 64bit
> off_t the same as the case where a off64_t is available (and the
> other 64bit off_t-equivalent cases); namely using off_t as mt_size_t.
> 
> Thanks to riastradh at netbsd.org for pointing out where the bug
> in llong.h was.
> 
> $NetBSD$
> 
> --- llong.h.orig        2010-10-03 16:00:42.000000000 +0000
> +++ llong.h
> @@ -25,7 +25,7 @@
>  /* if off_t is already 64 bits, be happy, and don't worry about the
>   * loff_t and llseek stuff */
>  #define MT_OFF_T off_t
> -#define MT_SIZE_T size_t
> +#define MT_SIZE_T off_t
>  #endif
> 
>  #ifndef MT_OFF_T
> 
> Regards,
>       -is
> 

Thanks for your contribution, but this patch defines size_t to be the
same off_t .  These are not the same (most notably, size_t is usually
unsigned whereas off_t is signed).

Is this intentional?

I mean, does NetBSD really have a 64 bit off_t but only a 32 bit size_t?

(I know, a similar "hack" is already in place for loff_t, but now that I
think about it, that should probably be revisited as well...)

Regards,

Alain



reply via email to

[Prev in Thread] Current Thread [Next in Thread]