Switching to [KMGTPE]i prefixes?

Warner Losh imp at bsdimp.com
Fri Mar 25 23:44:49 UTC 2011

On Mar 25, 2011, at 5:28 PM, Xin LI wrote:

> On Fri, Mar 25, 2011 at 2:50 PM, Warner Losh <imp at bsdimp.com> wrote:
>> How did you guys deal with programs like df that now need to do special buffer size hacks to get consistent results?
> I think it doesn't really matter - caller have to specify using IEC
> prefixes explicitly, so old binaries won't be broken.  They must be
> updated to use the IEC prefixes.

My patch had a 'force IEC prefixes' compile time option which did.

However, you'll have to monkey around with df to get it to do the right thing since the buffer sizes and such will need to be 1 longer for the extra 'i' in the mix now...  And it can' t be unconditional, since then you'd get different results with the non IEC case.

That's a short way of saying that this patch is necessary, but not sufficient for the current system.  We'll need a lot of tweaks to the rest of the system for it to behave correctly.


More information about the freebsd-hackers mailing list