From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 25 23:44:49 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA08106564A; Fri, 25 Mar 2011 23:44:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id BE7758FC12; Fri, 25 Mar 2011 23:44:48 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63] (may be forged)) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p2PNc6ql054135; Fri, 25 Mar 2011 17:38:08 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Fri, 25 Mar 2011 17:38:06 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <89A0FF76-7907-4815-85D2-F87968939B66@bsdimp.com> References: <20110325002115.GA323@freebsd.org> <20110325015508.GA14565@freebsd.org> <20110325024658.GA19544@freebsd.org> <336A9ACD-29BF-41C9-BC25-917CC1E4587D@bsdimp.com> <20110325195325.GA69264@freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.1082) Cc: Alexander Best , freebsd-hackers@freebsd.org Subject: Re: Switching to [KMGTPE]i prefixes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2011 23:44:49 -0000 On Mar 25, 2011, at 5:28 PM, Xin LI wrote: > On Fri, Mar 25, 2011 at 2:50 PM, Warner Losh wrote: >> How did you guys deal with programs like df that now need to do = special buffer size hacks to get consistent results? >=20 > 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. Warner