Sync some (mostly cosmetical) changes from NetBSD

Makefile,v 1.37
tc1.c v 1.3
Rename TEST/test.c tc1.c

common.c,v 1.23
pass lint on _LP64.

emacs.c,v 1.22
pass lint on _LP64.

filecomplete.h,v 1.8
mv NetBSD ID back from 1.9 as we don't
have the widecharacter support.

prompt.c,v 1.14
prompt.h,v 1.9
term.h,v 1.20
read.h,v 1.6
Update NetBSD version strings

sys.h,v 1.12
Misc sun stuff.

tty.c 1.31
handle EINTR in the termios operations
Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects.
pass lint on _LP64.
Don't depend on side effects inside an assert

MFC after:	1 week
Obtained from:	NetBSD
Separate out the links creation from the other targets. This was
supposed to have been done for the original commit, but somebody
forgot.

Pointy-hat-to:  imp@
Correct the accounting code for wired mappings.  The wrong field of the PVO
entry was being tested.  We were incrementing and decrementing the pmap's
wired mapping count based on whether the physical page being mapped or
unmapped was cache coherent, not whether it was a wired mapping.

Reviewed by:	nwhitehorn
Avoid relocking filedesc lock when closing fds during fdp destruction.

Don't call bzero nor fdunused from fdfree for such cases. It would do
unnecessary work and complain that the lock is not taken.

MFC after:	1 week
Don't zero fd_nfiles during fdp destruction.

Code trying to take a look has to check fd_refcnt and it is 0 by that time.

This is a follow up to r268505, without this the code would leak memory for
tables bigger than the default.

MFC after:	1 week
Make MK_GNUCXX mean "build the libstdc++ and libsupc++ libraries" and
nothing more. Force it to be "no" when MK_CXX is "no" to simplify
usage.  It no longer also means "build g++" since we no longer have a
platform where that's interesting now that pc98 no longer needs clang
and gcc, but not g++. pc98 now just uses clang after boot2 changes.
Don't make a temporary copy of fixed sysctl strings.
Eliminate plim and vtmp local vars in exit1.

No functional changes.

MFC after:	1 week
Use the correct offset when converting a logical address (segment:offset)
to a linear address.
Make this compile on older FreeBSD versions that don't have
APM_ENT_TYPE_APPLE_BOOT.
Fix condition.

Sponsored by:	Yandex LLC
Integrate upstream changes.

MFC after: 1 week
Remove unused readline header

Readline is no longer installed after r268461.  A readline compatibility
header is provided by libedit, but readline definitions do not seem to
be used by LLDB anyhow.

Submitted by:	markj, Jan Beich
All mbuf external free functions never fail, so let them be void.

Sponsored by:	Nginx, Inc.
Fix style bug: rename the refcount field of m_ext to ext_cnt, to match
other members.

Sponsored by:	Nginx, Inc.
Fix some edge cases with rewinddir():
- In the unionfs case, opendir() and fdopendir() read the directory's full
  contents and cache it.  This cache is not refreshed when rewinddir() is
  called, so rewinddir() will not notice updates to a directory.  Fix this
  by splitting the code to fetch a directory's contents out of
  __opendir_common() into a new _filldir() function and call this from
  rewinddir() when operating on a unionfs directory.
- If rewinddir() is called on a directory opened with fdopendir() before
  any directory entries are fetched, rewinddir() will not adjust the seek
  location of the backing file descriptor.  If the file descriptor passed
  to fdopendir() had a non-zero offset, the rewinddir() will not rewind to
  the beginning.  Fix this by always seeking back to 0 in rewinddir().
  This means the dd_rewind hack can also be removed.

While here, add missing locking to rewinddir().

CR:   	    	https://phabric.freebsd.org/D312
Reviewed by:	jilles
MFC after:	1 week
Remove redundant USE_INET6 test that enables INET6 in the ipfilter userland
regardless of the setting in make.conf.

PR:		190964
Approved by:	glebius (mentor)
MFC after:	1 week
Fix vmstat -M after r263620 renamed 'cnt' to 'vm_cnt'.

This was showing as:
  vmstat: undefined symbols:
   _cnt

To remain backwards compatible with older dumps, if 'vm_cnt' symbol is not
found then try again with 'cnt'.

Reported by:	pho
Sponsored by:	EMC / Isilon Storage Division
Bugfix: When a remote address was added to an endpoint,
a source address was selected and cached, but it was not
stored that is was cached. This resulted in selecting
different source addresses for the INIT-ACK and COOKIE-ACK
when possible.
Thanks to Niu Zhixiong for reporting the issue.

MFC after: 1 week
Improve reference counting of EXT_SFBUF pages attached to mbufs.

o Do not use UMA refcount zone. The problem with this zone is that
  several refcounting words (16 on amd64) share the same cache line,
  and issueing atomic(9) updates on them creates cache line contention.
  Also, allocating and freeing them is extra CPU cycles.
  Instead, refcount the page directly via vm_page_wire() and the sfbuf
  via sf_buf_alloc(sf_buf_page(sf)) [1].

o Call refcounting/freeing function for EXT_SFBUF via direct function
  call, instead of function pointer. This removes barrier for CPU
  branch predictor.

o Do not cleanup the mbuf to be freed in mb_free_ext(), merely to
  satisfy assertion in mb_dtor_mbuf(). Remove the assertion from
  mb_dtor_mbuf(). Use bcopy() instead of manual assignments to
  copy m_ext in mb_dupcl().

[1] This has some problems for now. Using sf_buf_alloc() merely to
    increase refcount is expensive, and is broken on sparc64. To be
    fixed.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.