Subject: Re: bin/3590: eliminate df floating point
To: None <fair@atomic.clock.org>
From: Simon Burge <simonb@telstra.com.au>
List: netbsd-bugs
Date: 05/09/1997 07:47:45
On Thu, 8 May 1997 12:27:21 -0700 (PDT)  "Erik E. Fair" wrote:

> >Number:         3590
> >Category:       bin
> >Synopsis:       df uses floating point and calls printf unnecessarily
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       medium
> >Responsible:    bin-bug-people (Utility Bug People)
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   net
> >Arrival-Date:   Thu May  8 12:35:01 1997
> >Last-Modified:
> >Originator:     Erik E. Fair
> >Organization:
> International Organization of Internet Clock Watchers
> >Release:        NetBSD-current, May 8, 1997
> >Environment:
> 
> System: NetBSD atomic.clock.org 1.2D NetBSD 1.2D (GENERIC) #42: Wed Apr 23 08:06:27 PDT 1997 root@atomic.clock.org:/
usr/src/sys/arch/sparc/compile/GENERIC sparc
> 
> 
> >Description:
> 	df uses a floating point calculation of percentage disk used, and
> 	percentage of inodes used. This causes df to core dump on systems
> 	which do not have a floating point unit, and whose floating point
> 	arithmetic emulation is not yet complete (e.g. any mc68LC040 system).
> 
> 	Calling printf to push simple strings out the door is silly.
> 	That's what {f,}puts(3) is for.

I can understand the want (or need) to get rid if unnecessary floating
point calculations from utilities, but is changing printf()s to puts()s
and puts()s going to make much of a difference?  I/O time to the screen
(or pty or whatever) is going to be far more overhead than going into
the prinf mechanism, and it makes it much easier to change a particular
printf to being formatted at a later time if the need arises.

Simon.
--
Simon Burge						simonb@telstra.com.au
UNIX Support, CPR Project.				+61 3 9634 3974 (Phone)
Telstra Corporation, Melbourne, Australia.		+61 3 9670 1189 (Fax)