Commit Graph

86 Commits

Author SHA1 Message Date
mlelstv 61ace358f2 block numbers are measured in f_frsize units. Make -P option
use this instead of f_bsize. Also account for reserved blocks
like normal non-P output.
Fixes PR bin/41541.
2009-06-06 09:30:45 +00:00
lukem 4a566726c2 sign-compare fix for amd64 2009-01-25 14:18:21 +00:00
lukem c6144e484f fix -Wsign-compare issues 2009-01-18 00:24:29 +00:00
lukem 2fe2731d3f Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 00:52:39 +00:00
christos 9655f5c24c PR/38755: murray armfield: /bin posix programs missing setprogname and/or
setlocale
2008-05-26 14:21:08 +00:00
christos 7d01361f62 do the -g -G swap for real. 2008-03-04 18:55:57 +00:00
christos 7ca37f5cdc PR/36817: Zafer Aydogan: Don't use -g to implement the same named option
in solaris to display statvfs output, use -G instead. I researched this
and all other implementations except Solaris (OS/X, FreeBSD, us before June
24, 2007) use -g to signify gigabytes. So revert to that.
PR/38154: YAMAMOTO Takashi: df -P doesn't work without -k. Fix from Anon Ymous
together with passing lint, and exiting with the right values.
2008-03-04 17:59:55 +00:00
yamt a9b7c5b63a restore whitespace between 'Filesystem' and 'blocks'. 2008-03-04 09:03:28 +00:00
yamt 16d01d9a96 prtstat: PRIdMAX -> jd as suggested by Joerg Sonnenberger. 2007-12-22 00:23:36 +00:00
yamt c7bc0cd0aa don't cast 64bit values to u_long. 2007-12-21 06:43:26 +00:00
christos fede0a77fc kill MFSNAMELEN 2007-07-17 20:03:10 +00:00
christos 94ae12d450 Fix '-Ph' segfault; from Greg Woods 2007-07-16 14:39:53 +00:00
christos 84c48917b8 spacing fixes from Geoff Wing 2007-07-03 14:39:47 +00:00
christos 98d594125d PR/36541: Greg A. Woods: fix -P option, and add solaris -g option. 2007-06-24 01:52:46 +00:00
christos ccd5bfd356 fix formatting of df -h; from Zafer. 2006-09-04 16:32:57 +00:00
christos b65b7f50b1 -h and -[mgk] are mutually exclusive. Only use the last specified. [from zafer]
Use one variable instead of 3 flags to hold the scale, so that we don't have
to reset each flag.
2006-08-21 19:05:14 +00:00
rumble 3ad5f13d80 Handle malloc returning NULL. 2006-03-17 13:53:31 +00:00
elad f909cee7d7 PR/23688: don't say we're printing in 1k-blocks if -h was also specified. 2006-01-13 14:07:57 +00:00
christos 6310b59691 sprinkle a little const, and now everything compiles with WARNS=3 2005-06-26 19:10:48 +00:00
augustss 6258e74613 Use the same width (9) for both the Used and Avail columns. 2004-12-31 09:54:28 +00:00
enami 56ab99cb0c Drop LSBs when denominator is big. 2004-07-17 00:29:08 +00:00
enami e9bd9c26d8 Remove now unnecesary/incorrect cast. 2004-07-07 01:14:13 +00:00
enami 9bcbd6d9c6 - Remove unnecessary empty line.
- Wrap long line.
2004-07-07 01:10:58 +00:00
martin dc1011f1c9 Available block count may be negative - so make the calculation signed.
This avoids output like:
Filesystem      1K-blocks     Used     Avail Capacity  Mounted on
/dev/wd1a           11799    11276 9223372036854775741   100%    /boot
2004-07-04 15:31:50 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
enami 489a45ccd1 Combine two printf()s back to one. There was a reason to split in my
old patch but no reason to do so in the final version.
2004-03-26 20:28:39 +00:00
enami f31e685fc4 Prevent sign extension for positive value, and f_bavail if it is considered
as positive value.
2004-03-26 20:19:03 +00:00
enami efbe8a95d8 Fix an output of df -h when the value is negative; we need to provide
space for minus sign.
2004-03-26 20:07:47 +00:00
enami 5824b24c95 No need to reference through a pointer; just refer the array of
character directly.
2004-03-26 20:00:32 +00:00
enami 2229c36a99 Don't put space before close paren. 2004-03-26 19:53:53 +00:00
enami bf27454854 Use signed 64bit integer type instead of unsigned long long
since f_bavail may be negative.
2004-03-07 01:12:08 +00:00
enami 90ded884a4 Backout recent undocumented change to keep an output same as before. 2004-03-02 23:13:07 +00:00
christos a2989006c9 fix compilation on LP64 systems. 2004-03-02 15:04:55 +00:00
itojun 1e9b827214 cast to unsigned long long before computing to avoid overflow 2004-03-02 03:59:17 +00:00
itojun 96b84a38a0 use unsigned long long to print block count. 2004-03-02 03:50:45 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
perry 375e81b270 Some file systems, like FAT, have no inodes in the ffs sense and don't
run out of inodes. df -i was saying, however, that such file systems
had 100% of their inodes in use, which would do things like trigger
alarms in scripts looking for file systems that have run out.

Instead, say 0% are in use, which although not strictly true is at
least less wrong, fixes scripts and is less worrying in nightly reports.
2003-12-07 22:42:36 +00:00
agc b5b2954259 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-07 09:05:01 +00:00
simonb ec137f4f6b Bump ifree/iused field width. 2003-07-12 15:58:54 +00:00
grant 6321639a84 change -G arg to -g.
-G was chosen as SuSv2 specified -g was already used in ls(1), but ls
has no blocksize options like df/du, so this was redundant.

bump date in man page.
2003-04-18 12:48:25 +00:00
grant a1dd31060d add -G argument for output in gigabytes.
ok'd by perry@, mrg@
2003-04-16 14:00:30 +00:00
grant f3014f2c17 sync usage args with reality. 2003-04-16 12:57:24 +00:00
provos 4fd29e5dcf human-readable output via -h flag. output matches Linux and other BSDs.
partly from kstailey@openbsd.org.  approved itojun and perry.
2002-09-26 16:27:43 +00:00
soren e426c0fac8 Following FreeBSD's example, remove the old pre-statfs(2) code for
examining FFS filesystems directly. This also gets rid of df(1)'s
setgid operator bit.
2002-08-02 08:17:12 +00:00
christos bebeebd8aa if -a is not given, we need to walk the filesystem list to check the
flags in order to get the correct count (from enami)
2001-10-11 16:31:33 +00:00
enami 802d6b10df KNF. 2001-10-11 09:23:31 +00:00
cgd e459adfd7a use getprogname() 2001-02-20 23:02:07 +00:00
tsutsui 337db294f1 Adjust output column in printf(). 2001-02-01 10:19:51 +00:00
christos 3ca65e4438 eliminate nested extern 2001-01-07 05:37:10 +00:00
lukem f819878ce7 use more standard %ll_ in favour of %q_ 2001-01-04 15:39:50 +00:00