ddb: ANSI-fy function declarations.

MFC after:	5 days
Remove stale comments.
Add an AC line monitor so power_profile can work

Summary:
Add a polling loop (1Hz) to monitor the battery and AC status, to notify devd
like ACPI does for power monitoring.  This allows /etc/rc.d/power_profile to
work on PowerPC laptops

Test Plan:
Tested on a Titanium PowerBook, configuring economy_cpu_freq and
performance_cpu_freq, disabling powerd.

Reviewers: #powerpc, nwhitehorn

Reviewed By: nwhitehorn

Subscribers: rpaulo

Differential Revision: https://reviews.freebsd.org/D937
Implement 64MB memory limit for test to ensure that it fails reliably in
600 seconds; it would previously fail inconsistently when run in some virtual
machine configurations

This patch might need to be reverted or revisited later (see the attached PR
for more details)

PR: 169302

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
Fix compilation errors with missing wide-type headers and fix compilation
warnings with -Wformat

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
- Add libutil #include for fparseln
- Change ATF_REQUIRE_EQ_MSG to ATF_CHECK_EQ_MSG to gather all failing results
  possible (currently 12 with leftassoc)
- Mark leftassoc "atf_tc_expect_fail" on FreeBSD (PR coming soon after further
  analysis is done on the code)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
s/-/_/ in name.
A connection in TIME_WAIT state before calling close() actually did not
received any RST packet.  Do not set error to ECONNRESET in this case.

Differential Revision:	https://reviews.freebsd.org/D879
Reviewed by:		rpaulo, adrian
Approved by:		jhb (mentor)
Sponsored by:		Verisign, Inc.
Expect nice_err to fail on FreeBSD with unprivileged users

PR: 189821
Sponsored by: EMC / Isilon Storage Division
Check error return from reading integer part of temperature.

There's a very remote, but possible, chance that the integer part read will
fail, but the fraction read succeeds, at which point the reported temperature is
invalid.

Reported by: Matthew Rezny
MFC after:	3 weeks
Add #include <stdio.h> for printf

Sponsored by: EMC / Isilon Storage Division
Remove ALC_LOCK_ASSERT in alc_stop_queue().  This function is now
called in device attach without holding a driver lock so it
resulted in panic.

Reported by:	markj
Do initial port of contrib/netbsd-tests/lib/libc/locale

t_io:
- Expect failures potentially related to implementation-specific knowledge of
the zh_TW.Big5 locale [*]

t_mbrtowc:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)
- Expect failure with mbrtowc_internal dealing with Japanese locales
(potentially related to implementation detail knowledge of the ja_* locales) [*].

t_mbstowcs, t_mbtowc, t_wctomb:
- Handle unknown locales more gracefully (do not test if the locale doesn't
exist)

t_wcstod:
- Treat FreeBSD like NetBSD and Linux in the XXX: FIXME section

[*] More investigation is required to determine the root cause of the failures

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
memmem with NUL length "needle" (aka small) strings on FreeBSD/OSX returns
NULL instead of the "haystack" value (aka big)

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
Use 1 as a random seed, as recommended in srandom(3). Adjust the random values
accordingly

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
Add #include <stdio.h> to get sys_nerr definition

Sponsored by: EMC / Isilon Storage Division
__isnanl is automatically picked according to data type in <math.h>. There
isn't a need for the explicit __isnanl test

Sponsored by: EMC / Isilon Storage Division
Only test the return value in mktime_negyear

Testing for the errno is an optional requirement according to POSIX, and
FreeBSD doesn't document that errno would be set on failure with mktime

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division
Change ATF_REQUIRE_MSG calls to ATF_CHECK_MSG to get as many errors as possible

t_strptime:common..
- Expect the testcase body as a whole to fail. Multiple PRs will be filed to
track the issues (there are 18 check failures)

t_strptime:day..
- %EA and %OA seem to be case insensitive on FreeBSD
Add a tunable for arc_shrink_shift (vfs.zfs.arc_shrink_shift) that
controls how much fraction, 1/2^arc_shrink_shift, should be reclaimed
when there is memory pressure.

Submitted by:	Richard Kojedzinszky <krichy at tvnetwork.hu>
MFC after:	2 weeks