Commit Graph

25 Commits

Author SHA1 Message Date
kris
d3d33000fe GC some dead code relating to running df on unmounted block devices,
and remove the setgid operator bit from the installed binary: if you want
to view free disk space on an unmounted device, you should have read
permissions to access it.

Reviewed by:	phk
2001-05-08 06:58:25 +00:00
jwd
e64034fa46 Add -g for gigabyte sizes.
Approved by:	jkh
2000-06-03 20:17:39 +00:00
mharo
a67c7a1db7 add human readable output (-h and -H)
Obtained from:	parts of human readable code from OpenBSD
Reviewed by:	obrien

add POSIX, byte and megabyte block size ouput flags

PR:		13579 (POSIX flag)
Submitted by:	Mike Meyer <mwm@phone.net>
1999-12-15 03:44:09 +00:00
julian
88e6664e72 Most modern OSs have the ability to flag certain mounts as ones to
be ignored by default by the df(1) program.  This is used mostly to
avoid stat()-ing entries that do not represent "real" disk mount
points (such as those made by an automounter such as amd.)  It is
also useful not to have to stat() these entries because it takes
longer to report them that for other file systems, being that these
mount points are served by a user-level file server and resulting in
several context switches.  Worse, if the automounter is down
unexpectedly, a causal df(1) will hang in an interruptible way.

PR:		kern/9764
Submitted by:	Erez Zadok <ezk@cs.columbia.edu>
1999-11-01 04:57:43 +00:00
peter
66312e4a8d $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
peter
858805daf7 Cleaning out old stuff from one of my source trees:
use mkdtemp() rather than mktemp() and fix a trivial memory leak.
1998-12-16 05:29:09 +00:00
joerg
aa68663b55 Style police: keep a variable list in alphabetical order, and add
pointless paren's to return statements.

Nitpicked by:	bde :)
1997-10-13 09:36:05 +00:00
joerg
8eaf7f4121 Make df(1) exit with non-success status if something went wrong.
PR:		bin/4415
1997-10-12 13:55:43 +00:00
steve
548d1c0056 Add Bruce's _NEW_VFSCONF flag to make this compile cleanly and
sccsid -> rcsid.
1997-08-07 21:31:00 +00:00
imp
054f35c222 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
bde
55186ebb5b Merged from Lite2. The -t option is now handled better. The only visible
change should be that the usage message now actually matches the man page.
1997-03-13 17:41:37 +00:00
guido
2f74bc969e This is a funny one: df for a device that was not mounted used to fail
for root only.
1997-03-10 19:39:43 +00:00
peter
83b3c2c161 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
f8cd22bf39 Include <ufs/ufs/ufsmount.h>. 1997-02-17 05:26:08 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
steve
88dfe6ac44 Merge Lite2 mods, cleanup man page, and -Wall cleaning. 1996-12-14 05:56:03 +00:00
jkh
25f273a087 The manual page of df called cd9660 file systems by the name
isofs while the df command itself used the name iso9660fs or
        cdfs. Both of these were inconsistent with the name cd9660 which
        is used by the mount command. I modified df to recognize all of
        the names cd9660, cdfs, isofs, and iso9660fs, and take them all
        to refer to the same thing. Naturally I added a note of this
        behaviour in the manual page too.

Submitted-By: Jukka Ukkonen <jau@jau.csc.fi>
1996-12-11 10:01:56 +00:00
bde
d1eb245b0a Partially fixed negative and truncated "Avail" counts in df output.
This fixes PR943.

ffs/ffs_vfsops.c:
ffs_statfs() multiplied by (100 - minfree) as part of calculating the
minfree percentage (complemented in 100%), so with the standard minfree
of 8, it was broken for file systems of size >= 1TB/92 = 11GB.  Use the
standard freespace() macro instead.  This also fixes a rounding bug (the
"Avail" count was sometimes 1 too small).

ffs/* (not fixed):
The freespace() macro multiplies by minfree, so with the standard
minfree of 8, it is broken for file systems of size >= 1TB/8 = 128GB.
This bug is more serious since it affects block allocation.

ffs/ffs_alloc.c (not fixed):
Ordinary users are sometimes allowed to allocate 1 (partial) block
too many so that the "Avail" count goes negative.  E.g., if there is
1 fragment available and the file is fairly large, one more full
block is allocated.

df/df.c:
ufs_df() used/uses essentially the same code as ffs_statfs(), so it
had/has the same bugs.

ufs_df() gratuitously replaced "Avail" counts of < 0 by 0, so it
gave different results for non-mounted file systems in this case.
1996-01-14 18:55:09 +00:00
rgrimes
1888033949 Remove trailing whitespace.
Reviewed by:	phk
1995-05-30 00:07:29 +00:00
joerg
c6030c6511 You will find enclosed some changes to make gcc -Wall more happy in
/usr/src/bin. Note that some patches are still needed in that directory.

I (Joerg) finished most of Philippe's cleanup.  /bin/sh will still
need *allot* of work, however.

Submitted by:	charnier@lirmm.fr (Philippe Charnier)
1995-03-19 13:29:28 +00:00
dg
8722740e7f Added $Id$ 1994-09-24 02:59:15 +00:00
dg
1e4a2dfbef The last commit was bogus...the putenv doesn't affect the parent process,
so the BLOCKSIZE doesn't need to be preserved.
Also initialized the flags variables, and used 1k instead of 1024 for
BLOCKSIZE.
1994-08-12 10:23:49 +00:00
dg
679aa90292 Implemented the -k flag more properly...don't destroy the user's setting
of the BLOCKSIZE environment variable.
1994-08-12 07:26:52 +00:00
wollman
670a01d488 Gimme back my `-k' option!
Also document `-t' option in the usage message.
1994-08-10 19:21:07 +00:00
rgrimes
e3cfc8ce61 BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00