Import atf-0.21:

Released on October 23rd, 2014.

* Restored the atf(7) manual page to serve as a reference to all the other
  manual pages shipped by ATF.

* Added the -s flag to atf-sh to support specifying the shell interpreter
  to be used.

* Removed ATF_WORKDIR.  The only remaining consumers have been converted to
  use the standard TMPDIR environment variable.  As a benefit, and because
  Kyua forces the TMPDIR to live within the test case's work directory,
  any stale files left behind by ATF will be automatically cleaned up.

* Documented the environment variables recognized by each component in the
  relevant manual pages.  This information was lost with the atf-config(1)
  removal.

* Added a new "require.diskspace" metadata property to test cases so that
  they can specify the minimum amount of disk space required for the test
  to run.

* Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for
  discoverability purposes.  Symbolic links are provided for the time
  being to still make the old names visible.

* Issue #5: Recommend the (expected, actual) idiom for calls to the test
  macros in the manual pages.

* Issue #7: Stopped catching unhandled exceptions in atf-c++ tests.  This
  propagates the crash to the caller, which in turn allows it to obtain
  proper debugging information.  In particular, Kyua should now be able to
  extract a stacktrace pinpointing the problem.

* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang
  that ships with FreeBSD 11.0-CURRENT.

* Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better
  explaining how they relate to each other.

* Issue #14: Stopped setting 'set -e' in atf-sh.  This setting was
  initially added as a way to enable a "strict" mode in the library and to
  make test cases fail fast when they run unprotected commands.  However,
  doing so in the library is surprising as the responsibility of enabling
  'set -e' should be on the user's code.  Also, 'set -e' introduces
  inconsistent behavior on subshells and users do not expect that.

* Issue #15: Fixed atf_utils_{fork,wait} to support nested calls.

* Issue #16: Fixed test failures (by removing a long-standing hack) on
  systems that lack \e support in printf(1).

* Issue #19: Removed stale references to atf-config and atf-run.
filedesc: tidy up fdfree

Implement fdefree_last variant and get rid of 'last' parameter.

No functional changes.
filedesc: iterate over fd table only once in fdcopy

While here add 'fdused_init' which does not perform unnecessary work.

Drop FILEDESC_LOCK_ASSERT from fdisused and rely on callers to hold
it when appropriate. This function is only used with INVARIANTS.

No functional changes intended.
filedesc: make fdinit return with source filedesc locked and new one sized
appropriately

Assert FILEDESC_XLOCK_ASSERT only for already used tables in fdgrowtable.
We don't have to call it with the lock held if we are just creating new
filedesc.

As a side note, strictly speaking processes can have fdtables with
fd_lastfile = -1, but then they cannot enter fdgrowtable. Very first file
descriptor they get will be 0 and the only syscall allowing to choose fd number
requires an active file descriptor. Should this ever change, we can add an 'init'
(or similar) parameter to fdgrowtable.
Build mount_nfs(8) with WARNS=6.

Reviewed by:	rmacklem@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
filedesc: fix missed comments about fdsetugidsafety

While here just note that both fdsetugidsafety and fdcheckstd take sleepable
locks.
Only put one CTASSERT() inside each macro to avoid compile issues.
The problem is that the __LINE__ macro is constant inside a macro and
results in identical assert statements when the compiler does not
support the static builtin assert function.

MFC:		3 days
Sponsored by:	Mellanox Technologies
filedesc: drop retval argument from do_dup

It was almost always td_retval anyway.

For the one case where it is not, preserve the old value across the call.
Build ttm_agp_backend.c.

Reported by:	dumbbell
MFC after:	1 month
Fix typo.
Use in_localip() instead of handmade implementation.

MFC after:	1 week
Sponsored by:	Yandex LLC
Print human-readable error for "route not found" case.

Submitted by:	vsevolod (initial version)
MFC after:	2 weeks
Sponsored by:	Yandex LLC
Add /etc/rc.d/initrandom, which was removed in r273872.

Noticed by:	ache@
Fix usage of kern_getenv().
Remove the check for packets with broadcast source from if_gif's encapcheck.

The check was recommened in the draft-ietf-ngtrans-mech-05.txt. But it isn't
clear, should it compare the source with all direct broadcast addresses in the
system or not.
RFC 4213 says it is enough to verify that the source address is the address
of the encapsulator, as configured on the decapsulator. And this verification
can be extended by administrator with any other forms of IPv4 ingress filtering.

Discussed with:	glebius, melifaro
Sponsored by:	Yandex LLC
Use macro ERROUT() to make code more laconic and follow style of other
netgraph code.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov gmail.com>
Add type qualifier volatile to the base (userspace) address argument
of fuword(9) and suword(9).  This makes the functions type-compatible
with volatile objects and does not require devolatile force, e.g. in
kern_umtx.c.

Requested by:	bde
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Clean up the types of a few strings to make them const when they are never
written to.
The command name is a constant, use the correct type.

MFC after:	1 week
Fix the gpiobus locking by using a more sane model where it isn't necessary
hold the gpiobus lock between the gpio calls.

gpiobus_acquire_lock() now accepts a third parameter which tells gpiobus
what to do when the bus is already busy.

When GPIOBUS_WAIT wait is used, the calling thread will be put to sleep
until the bus became free.

With GPIOBUS_DONTWAIT the calling thread will receive EWOULDBLOCK right
away and then it can act upon.

This fixes the gpioiic(4) locking issues that arises when doing multiple
concurrent access on the bus.