summaryrefslogtreecommitdiff
path: root/bin/df/df.c
AgeCommit message (Collapse)Author
2001-07-09Compute %used in -P mode as a double, just like we do in normal printingTodd C. Miller
mode. Fixes an int wraparound problem noted by mike@erdelynet.com
2001-02-23Avoid potential uninitialized variablePaul Janzen
2000-10-18sort out printf formats according to types, 64bit arithmetics in ffs_df; ↵Michael Shalayeff
millert@ ok
2000-03-24Make f_bsize signed. Having it unsigned causes surprising (and unwanted)Todd C. Miller
type coercions. With this fixed I can back out the hack in df.
1999-12-31In prtstat() use u_int32_t and int32_t, not long and castTodd C. Miller
sfsp->f_bsize to be signed when using the fsbtoblk() macro so we get signed divide, not unsigned divide. Fixes a bug in df when the filesystem has < 0 blocks available to the user. Guess I should have just made f_bsize signed when struct statfs was changed.
1999-05-31New struct statfs with mount options. NOTE: this replaces statfs(2),Todd C. Miller
fstatfs(2), and getfsstat(2) so you will need to build a new kernel before doing a "make build" or you will get "unimplemented syscall" errors. The new struct statfs has the following featuires: o Has a u_int32_t flags field--now softdep can have a real flag. o Uses u_int32_t instead of longs (nicer on the alpha). Note: the man page used to lie about setting invalid/unused fields to -1. SunOS does that but our code never has. o Gets rid of f_type completely. It hasn't been used since NetBSD 0.9 and having it there but always 0 is confusing. It is conceivable that this may cause some old code to not compile but that is better than silently breaking. o Adds a mount_info union that contains the FSTYPE_args struct. This means that "mount" can now tell you all the options a filesystem was mounted with. This is especially nice for NFS. Other changes: o The linux statfs emulation didn't convert between BSD fs names and linux f_type numbers. Now it does, since the BSD f_type number is useless to linux apps (and has been removed anyway) o FreeBSD's struct statfs is different from our (both old and new) and thus needs conversion. Previously, the OpenBSD syscalls were used without any real translation. o mount(8) will now show extra info when invoked with no arguments. However, to see *everything* you need to use the -v (verbose) flag.
1999-01-31When adjusting units for -h mode, use the absolute value to check forTodd C. Miller
kb, mega, giga, etc. Based on a change from kstailey@openbsd.org but fixed differently.
1998-08-18people who fail to update man pages and usage lines will henceforth be shot ↵Theo de Raadt
on sight
1998-08-17fix df -P on 0-size filesystemsTheo de Raadt
1997-11-20Fix units conversion wrt -h flag to be correct (and consistent withTodd C. Miller
the GNU df's -h flag).
1997-09-01i am bored enough to fix terminal space/tab ugliesTheo de Raadt
1997-08-19Add -P option, the POSIX 1003.2 output format (strictly specified for parsing).denny
1997-07-23tabifykstailey
1997-06-16Better support for unmounted filesystems (i.e. df /dev/rsd0a):denny
- interpret the superblock of lfs, ext2fs, and ffs filesystems. - never mount() an offline filesystem, always read its superblock. - use the same algorithm as statfs() for ffs, get the same answers. Even so, now I'm really unsure this code should remain in df. Similar functionality should be added to dumpfs or fsck instead.
1997-06-01From denny@c200234-a.frmt1.sfba.home.com, check superblock magic number.Jason Downs
I'm unsure if this code should even remain in df.
1997-04-14make -h columns more compactkstailey
1997-04-14switch from <blank> to "B" for byte suffix; columns look too ugly otherwisekstailey
1997-04-14fix Avail column in -h mode (again)kstailey
1997-04-14fix Avail column in -h modekstailey
1997-04-14new "-h" (human-readable) output flag now works, please test. thxkstailey
1997-04-12start of -h (human readable) flag. more to comekstailey
1997-04-04when mktemp() is hard to fix, use 10 XTheo de Raadt
1996-12-24indicate this mktemp is vulnerable to a DOS attack, however the impact is ↵Theo de Raadt
very low
1996-12-14-Wall'ing.Michael Shalayeff
1996-12-07handle -t & -l in more cases; netbsd pr#2869, hubert.feyrer@rz.uni-regensburg.deTheo de Raadt
1996-08-02zap getopt() case of -?, come on, it is the default!Theo de Raadt
1996-06-23update rcsidTheo de Raadt
1995-11-06complete ufs -> ffs change (From John Kohl; PR #1403)Theo de Raadt
1995-10-18initial import of NetBSD treeTheo de Raadt