Use _exit instead of exit so the file descriptors aren't flushed twice in the
child processes

Submitted by: pho
Only expect timeouts on powerpc with NetBSD

Submitted by: pho
Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSD

PR: 191906
In collaboration with: pho
Add pthread_np.h #include and initialize the pthread attribute on FreeBSD

Submitted by: pho
#ifdef out a printf on !NetBSD that causes the testcase to fail when comparing
the output from the helper program

Submitted by: pho
Port helper program to FreeBSD, similar to ../../lib/libc/stdlib/h_atexit.c

Submitted by: pho
In collaboration with: kib
Add missing sys/time.h #include for timespecsub macro in lib/libnetbsd/sys/time.h
Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as
lib/libthr/tests

A variant of this code has been tested on amd64/i386 for some time by
EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
code will remain off until it's proven it works on virtual hardware or real
hardware on other architectures

Original work by: pho
Sponsored by: EMC / Isilon Storage Division
Call sem_unlink on semaphores before attempting to create them

Due to the lack of uniqueness in the semaphore name, and the fact that the
tests don't have cleanup routines, an interrupted test can leave a semaphore
"laying around", causing all subsequent attempts to run the test to fail

I will file a NetBSD PR for this issue soon
Add reachover Makefiles for contrib/netbsd-tests/lib/librt

A variant of this code has been tested on amd64/i386 for some time by
EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
code will remain off until it's proven it works on virtual hardware or real
hardware on other architectures

Sponsored by: EMC / Isilon Storage Division
Convert tools/regression/lib/libc/gen/test-arc4random into an ATF testcase and
rename as lib/libc/gen/arc4random_test

Sponsored by: EMC / Isilon Storage Division
Remove test-arc4random from this Makefile so others can continue to use
this as-is for the time being
Default to use 10 seconds as nap interval instead of 1.

Previously, we have a nap interval of 1 second while we have a timeout of
128 seconds by default, which could be an overkill, and for some hardware
the patting action may be expensive.

Note that the choice of nap interval is still arbitrary.  We preferred
a safe value where even when the system is very heavily loaded, the
watchdog should not shoot the system down if it's not really hung.
According to the manual page of Linux's watchdog daemon, the nap interval
time of theirs is 10 seconds, which seems to be a reasonable value --
according to Intel documentation AP-725 (Document Number: 292273-001),
ICH5's maximum timeout is about 37.5 seconds, which the ichwd(4) driver
would set when we requested 128 seconds (although it should probably
feed back this as an error and do not set the timeout).  Since that's
the shortest maximum value, 10 seconds seems to be a right choice for
us too.

Discussed with:	alfred
MFC after:	1 month
Merge remote-tracking branch 'freebsd/master' into hardened/current/master
Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/segvguard