[Toybox] dd cleanup notes

Rob Landley rob at landley.net
Tue Jul 12 12:18:57 PDT 2016


On 07/12/2016 01:18 PM, enh wrote:
> On Tue, Jul 12, 2016 at 11:03 AM, Rob Landley <rob at landley.net> wrote:
>> I.E. ubuntu has an extra "B" suffix meaning decimal,and this has an
>> extra "D" meaning decimal...? (I can add it to atolx(), just... lemme
>> know what makes sense here?)
> 
> yeah, it's a mess. fwiw, the BSD dd we're currently using on Android
> just doesn't support decimal, and no-one's ever said anything. (they
> did complain about the inability to specify things in hex [already
> fixed], so it's not like they're not paying attention :-) .)

What's the syntax for specifying things in hex? I'm not spotting it in
the ubuntu dd man page...

>> That's capping the range to LONG_MAX. So half the uses here are acting
>> like atolx_range() _ANYWAY_, although count= seek= and skip= can do the
>> full unsigned long long range. So if you fed in a block size of 4G it
>> would go "boing" even on 64 gigs...
> 
> the BSD dd we're currently using on Android caps block sizes to
> *u*int_max, and the others to *ll*ong_max.

If I convert atolx_range() to consume/return long long but don't change
the name and leave its existing users with their types, it should
autoconvert and work. Slight loss of efficiency on 32 bit, but eh.

Still not easy to fix truncate -s 8G on 32bit, but nobody seems to have
noticed so far, so...

Rob



More information about the Toybox mailing list