[Toybox] dd cleanup notes

enh enh at google.com
Tue Jul 12 12:20:25 PDT 2016


On Tue, Jul 12, 2016 at 12:18 PM, Rob Landley <rob at landley.net> wrote:
> 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...

just 0x, like normal. my recent patch just changed the hard-coded base
10 in the strtoull to 0.

>>> 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



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.


More information about the Toybox mailing list