This is to avoid redefining prototypes from the libc headers. Also,
simplify the autoconf function checks and remove some copy/paste
errors checking for 'write'.
ok wouter@
Note that gcc chose to disable this rather than cause link issues with
older copies of Solaris 10:
https://gcc.gnu.org/ml/gcc-patches/2012-01/msg00816.html
If we want to support Solaris <10.10 (I'd rather support up-to-date
versions), getentropy_solaris would need to change.
If an OS provides an arc4random_buf implementation in its C library,
prefer it over an in-library version. This allows OS-specific
implementations to become more robust over time. It also prevents
possible link-time confusion as to which arc4random_buf implementation
is in use by an application when linked with LibreSSL.
The built-in unit tests will identify some common issues, such as fork
safety and PID wrap handling. Other elements, such as seeding
mechanisms, should be audited by the vendor or user for correctness.
ok deraadt@ beck@
The original author clarified the license, so we are fine to ship with
the PID wraparound test. Run it by default if libressl is using the
native arc4random supplied from the OS.
ok deraadt@
Use canonical host rather than target so that this works:
CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32
Conditionally compile Linux issetugid compatibility function
ok beck@
From kettenis@
People have suggested using pthread_atfork(3) before, but discarded
the idea because it involves linking with -lpthread, which has other
undesirable consequences. However:
* Most systems actually have pthread_atfork(3) in libc. I verified
this on OS X and Solaris. I believe this is the case on Linux
systems that use musl as well.
* On Linux systems that use glibc, this isn't the case. However,
those systems have __register_atfork(3), which is fully documented
in the "Linux Standard Base Core Specification".
ok kettenis@ deraadt@ beck@