[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Patch / RFC: add "flashcp" applet
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2009-12-14 19:02:04
Message-ID: 1158166a0912141102v1d6e870aqa93876eeff6806e0 () mail ! gmail ! com
[Download RAW message or body]

On Fri, Dec 11, 2009 at 3:59 PM, Mikhail Gusarov
<dottedmag@dottedmag.net> wrote:
> Twas brillig at 15:53:22 11.12.2009 UTC+01 when
> stefan.seyfried@googlemail.com did gyre and gimble:
>
>  >> "int total"? This is 2009, 2 Gb limit is too tight.
>
>  SS> I'm still waiting to see MTD devices with more than two GB. Ok,
>  SS> unsigned int would be more conservative ;)
>
> 2GB already: http://wiki.mobileread.com/wiki/Nook
>
> It should be a matter of months to see bigger devices.

This is a moot point anyway. CONFIG_LFS controls this, and applet
should just obey that setting.

Which is very easy - just use off_t for file and device sizes.
If CONFIG_LFS=y, off_t will be "large" (at this point in human history
it means "64-bit"); if CONFIG_LFS is not set, off_t == long.
No lseek64, no O_LARGEFILE, nothing like that.
Thus, in 99,9% of cases you do not need to work hard to support it.
(Use "xxxxx %"OFF_FMT"u xxxxx" if you need to printf an off_t)

There are literally just a few applets which need to check ENABLE_LFS.
They need to convert string to off_t, and they do it like this:

#if ENABLE_LFS
#define XATOU_SFX xatoull_sfx
#else
#define XATOU_SFX xatoul_sfx
#endif

Perhaps this can be unified and fixed for the case when
"long long" is wider than off_t (future proofing).
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic