bug 2443: bin/cp: sync with FreeBSD (bug fixes + new options)

* Fix FTS_NOCHDIR behavior on empty directory.
* Add -a option (archive mode, equivalent to -RpP)
* Add -l option (create hard links instead of copying)
* Add -x option (FS mount points are not traversed)
* Preserve file flags on symlinks on cp -Rp
* Don't copy socket anyway after "xxx is a socket (not copied)"
* Avoid division-by-zero situations
* make -r synonym for -R but maintain -r behavior with -L

Taken-from: FreeBSD (multiple commits)
https://bugs.dragonflybsd.org/issues/2443
libc/fts: Use O_CLOEXEC for internal file descriptors

Because fts keeps internal file descriptors open across calls, making such
descriptors close-on-exec helps not only multi-threaded applications but
also single-threaded applications.

In particular, this prevents passing a temporary file descriptor for saving
the current directory to processes created via find -exec.

Taken-from: FreeBSD SVN 241010 (27 SEP 2012)
/bin/rm: fix removing symlinks with uchg/uappnd set

One error case described in FreeBSD PR bin/111226:
  /bin/rm when running as super user and failing to unlink a
  UF_APPEND|UF_IMMUTABLE protected symbolic link will reset the
  UF_APPEND and UF_IMMUTABLE flags on the symbolic link's target (if
  that target exists) - an object that /bin/rm should not touch! (Quote
  from SUSv3: "The rm utility removes symbolic links themselves, not
  the files they refer to, as a consequence of the dependence on the
  unlink() functionality").

There was a failure case for /usr/bin/find as well, but swildner
recently synchronized find with FreeBSD and fixed that one.

Taken-from: FreeBSD SVN 193087 (30 MAY 2009)
Merge branch 'master' into gsocdrm_alter
iwn: This driver never supported polling
wpi: This driver never supported polling
polling: Update manpage for device_polling to ifpoll switching
config: Remove device_polling from stock configures
firewire: Mention IFPOLL_ENABLE instead of DEVICE_POLLING
polling: Remove device_polling support
polling: Remove device_polling remainder

DEVICE_POLLING has no effect since this commit and will be nuked
after next release.
UPDATING: Mention DEVICE_POLLING is replaced by IFPOLL_ENABLE
/bin/mv: Sync with FreeBSD

1. Utilize central <paths.h> header
2. Meet posix spec for moving directory to existing non-empty directory
3. Meet posix spec for not moving directory over a file
4. Don't chop IO into pieces, use MAXPHYS
5. Add -h flag (similar to ln -h flag)
6. Test for input_is_terminal
7. Regression test added.

DETAILS
==========================================================================
1. remove pathnames.h file and add _PATH_RM to paths.h
2. Moving a directory to an existing non-empty directory will now fail as
   required.
3. Prior to change this test past, but after change it failed on
   cross-link devices.  Original code added to check for case and return
   -1 for the cross-link case.
4. Read files in one block and improve warn messages.
5. Using -h flag will force mv to treat a symbolic link to a directory
   for the target as a symbolic link instead of a directory.  This makes
   it possible to atomically update a symbolic link using rename().
6. POSIX requires this behavior:
   if (exists and (NOT f_options) AND
     ((not_writable AND input_is_terminal) OR i_option)) then
     prompt
   This behavior was implemented.
7. Passes all tests in suite.  Prior to change it failed 2 of 32 tests.
Update the pciconf(8) database.

November 14, 2012 snapshot from http://pciids.sourceforge.net/
Fix buildworld.

mv(1) is a bootstrap tool, hence it needs to build with host includes.
cp(1)/mv(1): Bring back a number of cleanups we did previously.

People (including myself) have put their time and thought into
this in the past, so we don't want this simply papered over with
the previous state.
nrelease/Makefile.usr: Relocate the git gc for pkgsrc to nrelease.

Since it was only meant for keeping the LiveDVD smaller, put it into
its build and don't force everyone to sit through it. The time it
takes seems to increase significantly on virtual machines with just
1G of RAM, for example. It seems to be quite memory hungry.

Reported-by: many
vfork.2: Document that vfork(2) returns pid_t.

Also adjust syscalls.master but it actually doesn't matter. These
adjustments are merely of a cosmetic nature.
Clean up references to some obsolete functions in manual pages.

sigpause(2)               -> sigsuspend(2)
sigsetmask(2)/sigblock(2) -> sigprocmask(2)
sigvec(2)                 -> sigaction(2)
alarm(3)                  -> setitimer(2)
pause(3)                  -> sigsuspend(2)

Based on similar changes in FreeBSD.
Remove an unused header.