From owner-svn-src-head@freebsd.org Sat Apr 15 19:17:20 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 5C85CD3F372; Sat, 15 Apr 2017 19:17:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D105BF5; Sat, 15 Apr 2017 19:17:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3FJHGs3013258; Sat, 15 Apr 2017 12:17:16 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3FJHGSf013257; Sat, 15 Apr 2017 12:17:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704151917.v3FJHGSf013257@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316938 - head/sbin/savecore In-Reply-To: <1774031.vuxxQt1GW8@ralph.baldwin.cx> To: John Baldwin Date: Sat, 15 Apr 2017 12:17:16 -0700 (PDT) CC: "Ngie Cooper (yaneurabeya)" , src-committers , rgrimes@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 19:17:20 -0000 > 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. Should that be reverted? My 5.4p8 man pages does not have any IEC units in it. Doesnt du -h print stuff in none IEC units, so this is kinda a man page vs actual code error. Oh wait, it is more errorful than that, using -h leaves off units and only prints scale of K/M/G/... and not KB/MB/GB :-(. > > 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.) Yes, and it would be nice to round out this functional set fixing its lack of uint64_t support, fixing all the things Bruce pointed out and then to start using it. Oh, and probably add an environment control to get either IEC or non IEC and scale either 1024 or 1000. -- Rod Grimes rgrimes@freebsd.org