From owner-svn-src-head@freebsd.org Sat Apr 15 15:11:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5CD8D3E43D; Sat, 15 Apr 2017 15:11:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 8E409852; Sat, 15 Apr 2017 15:11:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id AFB501A2009; Sun, 16 Apr 2017 01:11:20 +1000 (AEST) Date: Sun, 16 Apr 2017 01:11:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: "Ngie Cooper (yaneurabeya)" , src-committers , rgrimes@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <1774031.vuxxQt1GW8@ralph.baldwin.cx> Message-ID: <20170416003716.I2908@besplex.bde.org> References: <201704150149.v3F1nu0D009274@pdx.rh.CN85.dnsmgr.net> <4CBF25DF-F407-4F50-8724-B73F64734E19@gmail.com> <1774031.vuxxQt1GW8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=iKhvJSA4AAAA:8 a=BJNNuotrTlMSYgykdtQA:9 a=wmQd6wXe6-s_8t1q:21 a=HpH15m97YzivtNej:21 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 15:11:22 -0000 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 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