Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Apr 2017 01:11:20 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        John Baldwin <jhb@freebsd.org>
Cc:        "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>,  src-committers <src-committers@freebsd.org>, rgrimes@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r316938 - head/sbin/savecore
Message-ID:  <20170416003716.I2908@besplex.bde.org>
In-Reply-To: <1774031.vuxxQt1GW8@ralph.baldwin.cx>
References:  <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> <1774031.vuxxQt1GW8@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 15 Apr 2017, John Baldwin wrote:

> On Friday, April 14, 2017 07:40:57 PM Ngie Cooper wrote:
>>
>>> On Apr 14, 2017, at 18:49, Rodney W. Grimes <freebsd@pdx.rh.CN85.dnsmgr.net> wrote:
>>> Do we use KiB, MiB, GiB,... any place else in the system?  I cant think of
>>> a place we do this, so please, lets not start doing this here?
>
> The du manpage does at least.
>
>> humanize_number(3) from libutil uses IEC units.
>
> Note that it is optional though.  You can use flags to decide what you want
> and the default is to not use IEC.  ls -h uses humanize_number but not with
> IEC units.  In particular, there are flags to control the scaling and
> prefixes used: HN_DIVISOR_1000 and HN_IEC_PREFIXES.  The default is to use
> power-of-2 scaling with non-IEC prefixes (so KB == 1024 by default).
> Currently nothing in base uses HN_IEC_PREFIXES.
>
> (I see you already reverted the printf, just wanted to point out that the
> humanize_number behavior is configurable.)

There is already the environment variable BLOCKSIZE to turn off bogus units
in a for places.  I think most uses set this to 1 real K and barely remember
how bad the defaults are without it until they somehow run a shell without
it set (perhaps in single-user mode).  Its designers didn't forsee IEC
mistakes, else it would with be more than a single number, and have
meta-info to turn off bogus unit names.

ls(1) and df(1) don't properly document that -h (or whatever IEC mistakes
might be in it) have precedence over BLOCKSIZE.  du(1) does document this
properly.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170416003716.I2908>