Commit Graph

136 Commits

Author SHA1 Message Date
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
12cd1730ee Convert bin/ to LIBADD, reduce overlinking allow to build all components as
static
2014-11-25 11:15:40 +00:00
Simon J. Gerraty
488c975a1f Updated/new dependencies 2014-11-19 07:10:38 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Marcel Moolenaar
6fea8dc88f Document that df(1) supports libxo(3). 2014-11-07 03:07:10 +00:00
Marcel Moolenaar
b6ff8745aa Convert to use libxo.
Obtained from:  Phil Shafer <phil@juniper.net>
Sponsored by:   Juniper Networks, Inc.
2014-11-07 03:03:25 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Warren Block
3a97f8af0d -h and -H options backwards in manual page.
PR:		bin/183681 docs/183681
Submitted by:	Robin Hahling <robin.hahling@gw-computing.net>
MFC after:	3 days
2014-01-16 17:06:02 +00:00
Christian Brueffer
b5a8b741f7 Clean up a spurious "." in SEE ALSO.
MFC after:	3 days
2013-10-28 23:02:12 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Greg Lehey
c9e571fe9d Complete revision 243104. 2013-05-17 03:52:20 +00:00
Ulrich Spörlein
e83643f4f6 Don't appease clang static analyzer after all and roll back
the free(3) of mntbuf ... again. There's no point in doing
useless extra work when we're about to exit.

See also r240565.

Not reading file history:	uqs
2013-04-26 12:27:30 +00:00
Ulrich Spörlein
11ed25f278 bin/df: Fix unitialized use in prtstat
While here:
- use NULL in the context of pointers
- use memset instead of bzero throughout the file
- free memory to appease clang static analyzer

Found by:	Coverity Scan (the UNINIT one)
2013-04-20 12:41:05 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Xin LI
d6a55c6d3f Don't time travel back and use a present date.
Noticed by:	mckusick
2013-01-25 18:47:16 +00:00
Xin LI
7eb55d4d13 - Wrap long line;
- Add -, to SYNOPSIS section.

MFC after:	2 weeks
2013-01-24 05:36:37 +00:00
Greg Lehey
6b7aceb85b Handle large negative block counts correctly.
MFC after:	 2 weeks
2012-12-12 04:18:25 +00:00
Greg Lehey
71cfc6780e Update man pages and clarify a number of options.
Rework block count calculations to work correctly with small "block" sizes.

MFC after:	14 days
2012-11-16 03:33:34 +00:00
Sergey Kandaurov
d7e8bab568 Fix section number for pstat and swapinfo cross references.
MFC after:	3 days
2012-11-15 21:22:50 +00:00
Greg Lehey
019e4a53cb Add , (comma) option to print sizes grouped and separated by thousands
using the non-monetary separator returned by localeconv(3), typically
a comma or period.

MFC after:  14 days
2012-11-15 03:39:21 +00:00
Eitan Adler
65e415b16e Revert 240527:
mntbuf can poit to memory allocated by getmntinfo(3) which can't be freed

PR:		bin/171634
Approved by:	cperciva (implicit)
2012-09-16 16:08:20 +00:00
Eitan Adler
c5c62e5900 Free memory before exiting in order to
help tools understand that we're not leaking it.

PR:		bin/171634
Submitted by:	Erik Cederstrand <erik@cederstrand.dk>
Approved by:	cperciva
MFC after:	3 days
2012-09-14 23:47:23 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Eitan Adler
45b586acc4 Bump date to today (since I modified it)
PR:		bin/165321
Approved by:	gjb
MFC after:	3 days
2012-03-03 17:52:19 +00:00
Eitan Adler
2561992179 Direct users to swapinfo and pstat from df
PR:		bin/165321
Submitted by:	jhs
Approved by:	bcr
MFC after:	3 days
2012-03-03 15:38:01 +00:00
Dag-Erling Smørgrav
16352ac84a Minor clarification
MFC after:	3 weeks
2011-10-18 08:20:36 +00:00
Dag-Erling Smørgrav
7b0514fa02 Simplify df(1) by factoring out most of the common code:
- In the argc == 0 case, just populate the mount list as before, but
   do not calculate widths, update totals or print anything.

 - In the argv > 0 case, collect information about the requested file
   systems and store it in the mount list, but do not calculate
   widths, update totals or print anything.

 - In either case, once all the information has been collected,
   iterate once through the mount list to calculate widths and totals,
   then once more to print everything.

This also fixes two bugs: firstly, column widths were not calculated
correctly if more than one file system was specified on the command
line; and secondly, file systems with MNT_IGNORE were included in the
totals even if -a was not specified.

Noticed by:	Paul Schenkeveld
MFC after:	3 weeks
2011-10-18 08:18:26 +00:00
Rebecca Cran
6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Xin LI
431586a895 Staticify internal routines. 2009-06-23 23:30:56 +00:00
Simon L. B. Nielsen
b93ce3b716 Make "human-readable" (-H/-h) output also "humanize" inode counts.
Base 10 is always used for the inode counts as I could not think of any
reason base 2 inode counts would be useful.

Minor mdoc markup fix to df(1) while here anyway.

MFC after:	3 weeks
2009-06-07 09:06:21 +00:00
Pawel Jakub Dawidek
b56ca46588 Implement -T option as found in Linux df(1). When given, file system type
will be included in output.

Reviewed and tested by:		keramida
MFC after:	2 weeks
2008-11-23 13:03:44 +00:00
Sean Farley
2966d28c32 Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
 - unsetenv returns an int.
 - putenv takes a char * instead of const char *.
 - putenv no longer makes a copy of the input string.
 - errno is set appropriately for POSIX.  Exceptions involve bad environ
   variable and internal initialization code.  These both set errno to
   EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit.  A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions.  It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR:		kern/99826
Approved by:	wes
Approved by:	re (kensmith)
2007-07-04 00:00:41 +00:00
Andrey A. Chernov
ba174a5e38 Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug
reports (I receive nothing). But because I surprisingly meets so
strong opposition and resistance so lost any desire to continue that.

Anyone who interested in POSIX can dig out what changes and how
through cvs diffs.
2007-05-01 16:02:44 +00:00
Andrey A. Chernov
7c450364bc Eliminate error with -W* strict flags and make putenv() calls conforming to
standard in the same way as f.e. gcc internal portable code does.
2007-04-30 04:29:17 +00:00
Alexander Kabaev
2897dce81d getblocksize expects pointer to long as a second argument, not
a pointer to u_long.
2007-04-06 15:36:43 +00:00
Will Andrews
27f8233569 Fix a bug where the mutual exclusivity of the -l and -t options is not
recognized properly if -l is specified first.

PR:			bin/105721
MFC after:	1 week
2007-03-08 06:10:17 +00:00
Ruslan Ermilov
975ab35963 Fix markup. 2007-02-28 10:29:48 +00:00
Christian S.J. Peron
df464e4361 Based on The Open Group Base Specifications Issue 6 IEEE Std 1003.1, our
current implementation of df(1) is does not properly format the output under
certain conditions. Right now -kP and -Pk are not the same thing. Further,
when we set the BLOCKSIZE environment variable, we use "1k" instead of "1024",
making the header display incorrectly.

To quote the specification:

"When both the -k and -P options are specified, the following header line
 shall be written (in the POSIX locale):

"Filesystem 1024-blocks Used Available Capacity Mounted on\n"

- If -P has been specified, check to make sure that -k has not already been
  specified, if so, simply break instead of clobbering the previous blocksize
- Use 1024 instead of 1k to make the header POSIX compliant

Reported by:	Andriy Gapon
Discussed with:	bde, ru
MFC after:	1 week
2006-09-20 20:55:02 +00:00
Warner Losh
d7c881e895 Prefer strlcpy to strncpy. In one case, this saves us from re-zeroing
data that's alreday 0.  In another, it saves us from zeroing data that
will be overwritten again.
2006-08-20 06:32:40 +00:00
Ruslan Ermilov
6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Warner Losh
9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Ruslan Ermilov
6fa13ec06f Scheduled mdoc(7) sweep. 2005-01-09 19:54:23 +00:00
Christian S.J. Peron
239c9e601a Currently if a mount point is not accessible by the calling user,
invalid information will be printed if the -t flag is specified.

$ df -t ufs
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/ad0s1a    495726   139944   316124    31%    /
/dev/ad0s1e    253678     6438   226946     3%    /tmp
/dev/ad0s1f  56206340 13594248 38115586    26%    /usr
/dev/ad0s1d    694126    19812   618784     3%    /var
/dev/ad0s1d    694126    19812   618784     3%    /var
$

Note that the mount point which is not accessible shows
up as the previous file system that was printed. The reason
for this is that df -t will call statfs(2) on the pathname
supplied by getfsstat(2).

This is done to refresh the file system statistics in the
event that a previous file system had a long delay in
providing its stats.

This change affects the df utility in the following ways:
o Teach df has to deal with statfs(2) failing. If statfs(2)
  fails, fall back on the possibly stale stats provided by
  the initial call to getfsstat(2).
o Print a warning that the fs stats could possibly be stale
o Modify the man page and document this new behavior
  as a bug.

Approved by:	bmilekic (mentor)
PR:		68165
2004-07-20 18:24:47 +00:00
Ruslan Ermilov
eccea571a7 Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00