Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Apr 2003 20:32:57 +1000
From:      Tim Robbins <tjr@FreeBSD.ORG>
To:        Christoph Kukulies <kuku@physik.rwth-aachen.de>
Cc:        freebsd-current@freebsd.org
Subject:   Re: df displays 0.
Message-ID:  <20030414203257.A75820@dilbert.robbins.dropbear.id.au>
In-Reply-To: <200304141005.h3EA5GM01835@accms33.physik.rwth-aachen.de>; from kuku@physik.rwth-aachen.de on Mon, Apr 14, 2003 at 12:05:16PM %2B0200
References:  <200304141005.h3EA5GM01835@accms33.physik.rwth-aachen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 14, 2003 at 12:05:16PM +0200, Christoph Kukulies wrote:

> 
> Is this normal?:
> 
> www# df
> Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> /dev/ad0s1a    257838    72384   164828    31%    /
> devfs               1        1        0   100%    /dev
> /dev/ad0s1e    257838       22   237190    0.%    /tmp
> /dev/ad0s1f  57829724 12064820 41138528    23%    /usr
> /dev/ad0s1d    257838     8686   228526     4%    /var
> 
> I mean, the 0. percent on /tmp .

This is probably another problem with vfprintf()'s new floating point code.
I'm seeing the same problem here now that I've rebuilt /bin/df with a recent
libc. Here's a test program that demonstrates the problem. It's worth pointing
out that 0.0 is printed correctly as "0%", but 0+eps is printed as "0.%".

#include <float.h>
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{

	printf("%5.0f%%\n", 0.0);
	printf("%5.0f%%\n", DBL_EPSILON);
	exit(0);
}



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