The NetBSD libc tests use several definitions/macros that aren't available in
FreeBSD

Add the missing compat definitions/macros to lib/libnetbsd so the testcases
can be compiled with libnetbsd without having to invent ad hoc #define's, or
having to convert things over to FreeBSD idioms

Reviewed by: brooks
Phabric: D993
Sponsored by: EMC / Isilon Storage Division
Rename log2 to tal_log2.

Submitted by:	luigi
Revert r273481 so it can be recoded using fls(), which
some feel will make it more readable.
Clip the settings for the NFS rsize, wsize mount options
to a power of 2. For non-power of 2 settings, intermittent
page faults have been reported. Although the bug that causes
these page faults/crashes has not been identified, it does
not appear to occur when rsize, wsize is a power of 2.

Reported by:	tcberner@gmail.com
MFC after:	2 weeks
Avoid leaking data from the kernel environment: When we convert the
initial static environment to a dynamic one, zero the static environment
buffer, and zero individual values when kern_unsetenv and freeenv are
called.

Tested by:	kmoore (VM memory dump + grep)
Tested by:	cperciva (kernel panic dump + grep)
Fix some buglets in the error-handling of getdevice(). In particular, report
an error if the argument to pciconf -a doesn't have a unit number, rather
than triggering an assertion failure.

PR:		194506
Reported by:	Anthony Cornehl <accornehl@gmail.com>
Sponsored by:	EMC / Isilon Storage Division
Populate the GELI passphrase cache with the kern.geom.eli.passphrase
variable (if any) provided in the boot environment.  Unset it from
the kernel environment after doing this, so that the passphrase is
no longer present in kernel memory once we enter userland.

This will make it possible to provide a GELI passphrase via the boot
loader; FreeBSD's loader does not yet do this, but GRUB (and PCBSD)
will have support for this soon.

Tested by:	kmoore
MFV r273492: remove gettext files.
MFV r273494: xz 5.0.7.

MFC after:	2 weeks
Sync with NetBSD.

MFC after:	2 weeks
Unconditionally enable the clocks for all imx6 devices that we have drivers
for, or that are required to run the chip (such as busses).  Turn off all
the devices we don't yet have drivers for.

Some day we will have a fully functional imx6 clock driver so that we can
manage clocks based on fdt data.  This will have to do until then.
Add VirtIO console driver

Support for the multiport feature is mostly implemented, but currently
disabled due to some potential races in the hot plug code paths.

Requested by:	marcel
MFC after:	1 month
Relnotes:	yes
Add netinet/in.h for struct sockaddr_in

Sponsored by: EMC / Isilon Storage Division
Expect getgroups_err to fail on FreeBSD

PR: 189941
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
Port t_pipe2.c to FreeBSD

- Omit the pipe2_nosigpipe testcase on FreeBSD (FreeBSD doesn't have
  O_NOSIGPIPE).
- Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)".
- Save and restore the resource limit on the number of files (RLIMIT_NOFILE).

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
- Mark unused parameters __unused in handler
- Call sigqueue with getpid() instead of 0 -- the latter idiom appears to only
be valid on NetBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
Add limits.h #include for LINE_MAX

Sponsored by: EMC / Isilon Storage Division
Add sys/socket.h #include for struct sockaddr_in

Sponsored by: EMC / Isilon Storage Division
Port t_mmap.c to FreeBSD

- Add needed headers for the testcases
- Omit mmap_block on non-NetBSD OSes
- Use "security.bsd.map_at_zero" instead of "vm.user_va0_disable"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division