libc/db: Sync with FreeBSD

- libc/db/hash: cap auto-tuned block size with a value that actually
  works
- Consider flag == 0 as the same of flag == R_NEXT
- Minor changes from Berkeley DB 1.86 and further improvements from
  OpenBSD
- Allow O_SYNC and O_NOFOLLOW flags in dbopen()
- Plug memory leaks and a potential NULL dereference
- Simplify the logic when determining whether to zero out a db file to
  after open().
- When deleting a big key, the offset of an empty page should be bsize,
  not bsize-1
- Avoid overwriting the cursor page when the cursor page becomes the LRU
  page.
- Fix for sequential retrieval failure when using large key/data pairs.
- Fix a crash when iterating over a hash and removing its elements.
- Only squeeze a short key/value pair onto a page with other complete
  key/value pairs
- Return meaningful errno in overflow case
- Save errno before calling _close(), which may clear it
- Explicitly specify bit width for on-disk data structure.

Obtained-from:   FreeBSD
boot - Add loader.conf variable sioX.baud for console operation

* We already have 'comconsole' and 'sioX.flags=0x10' to set the
  serial port to use as the console, which the kernel boot uses.
  Add in 'sioX.baud' to set the baud rate, so we don't have to
  compile a custom kernel.

* Useful for IPMI setups.
boot - Clarify loader.conf documentation

* Add clarification for situations where you want the boot loader
  to use video output for IPMI purposes, but you want the kernel to
  use sio1.
i386: Partially revert 9e5e15787783090b6f8cc9f3dc990820c0d66248

* The new fake page handling changes were breaking assertions in the
  existing i386 pmap code.

* This commit fixes boot panics on i386
getservent.3: Adjust getservent() prototype.
drm: Fix incorrect usage of taskqueue_thread

Replace invalid occurences by taskqueue_thread[mycpuid]
kernel/drm2: Some build and warning fixes.
sh: Sync with FreeBSD

* Recognize "--" and explicitly reject options in wait builtin.
* Mention possible ambiguities with $(( and ((.
* Write as much into the heredoc pipe as possible, to avoid forking.
* Don't modify exit status when break/continue/return passes !.
* Document a few expansions for the $PS1 and $PS2 environmental
  variables.
* Don't consider jobs -s/-p as reporting the status of jobs.
* Improve error handling in read builtin.
* Use O_CLOEXEC and F_DUPFD_CLOEXEC instead of separate fcntl() call.
* Remove linked list of stack marks.
* Allow multiple operands in wait builtin.
* Return status 127 for unknown jobs in wait builtin.
* Do not read from stdin if an error occurs during -i -c cmd.
* Remove mkinit.

Obtained-from:   FreeBSD
test: Sync with FreeBSD.

* Add examples and non-standard primaries to the manual page.
* Reduce code size of ops table.
* Put some static keywords in the source code.
* Accept == as an alias of = which is a popular GNU extension.
* Add more regression tests.

-We have eaccess(2) now, so use it.

Obtained-from:   FreeBSD
test
drm: remove unused size parameter from drm_free
drm: consistently use drm_free()

Rename the drm specific kfree() wrapper to drm_free(), as free()
is confusing.
sh: Fix compilation for older DragonFly versions.

O_CLOEXEC and F_DUPFD_CLOEXEC were added in the past year, and since sh
is a bootstrap tool, older versions of DragonFly won't be able to
compile this latest version.

Reviewed-by:  swildner
kernel - Add hw.cpu_mwait_haltand hw.cpu_mwait_spin

* Add globals with machine-specific meanings.  This allows us to operate
  with MONITOR/MWAIT and gain the same power savings that we get with
  ACPI halt mode when idle.  Waiting on a follow-up commit to set the
  the defaults.

* For example, if we sysctl hw.cpu_mwait_halt=0x44 hw.cpu_mwait_spin=0x11
  (and leaving machdep.cpu_idle_hlt=2) on a haswell cpu it will shave the
  idle power down by another 5W, from 25W to 20W on an idle Haswell Xeon
  3.4 GHz server chip without impacting wakeup performance too badly.