getentropy
----------

Future POSIX specification:
 https://www.austingroupbugs.net/view.php?id=1134

Documentation:

  * Generating Unpredictable Bytes (libc),

  * man getentropy.

Gnulib module: getentropy

Portability problems fixed by Gnulib:

  * This function is missing on some platforms: glibc 2.24, Mac OS X 10.11, FreeBSD 11.0, NetBSD 9.0, OpenBSD 5.5, Minix 3.3, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.0, Cygwin 1.7.x, mingw, MSVC 14, Android 8.1.

  * This function is declared in <sys/random.h>, not in <unistd.h>, on some platforms: macOS 11.1, Solaris 11.4, Android 9.0.

Portability problems not fixed by Gnulib:

Although this function is intended to produce random data, the data's security properties may not be appropriate for your application. For example, identical ``random'' data streams might be produced by rebooted virtual machines.  If this is of concern you may need to use additional techniques such as hedging. (Ristenpart T, Yilek S. When good randomness goes bad: virtual machine vulnerabilities and hedging deployed cryptography (http://pages.cs.wisc.edu/~rist/papers/sslhedge.pdf). NDSS 2010.)

Related modules include getrandom, which has a more-flexible but more-complex API, and crypto/gc-random, which is likely a better match for code already using the other crypto APIs.