Skip to content
Snippets Groups Projects
  • Janne Blomqvist's avatar
    d66d6d15
    Use getentropy() for seeding PRNG · d66d6d15
    Janne Blomqvist authored
    The getentropy function, found on Linux, OpenBSD, and recently also
    FreeBSD, can be used to get random bytes to initialize the PRNG.  It
    is similar to the traditional way of reading from /dev/urandom, but
    being a system call rather than a special file, it doesn't suffer from
    problems like running out of file descriptors, or failure when running
    in a container where /dev/urandom may not be available.
    
    Regtested on x86_64-pc-linux-gnu, Ok for trunk?
    
    2018-08-13  Janne Blomqvist  <jb@gcc.gnu.org>
    
    	* configure.ac: Check for getentropy.
    	* intrinsics/random.c (getosrandom): Use getentropy if available.
    	* config.h.in: Regenerated.
    	* configure: Regenerated.
    
    From-SVN: r263522
    d66d6d15
    History
    Use getentropy() for seeding PRNG
    Janne Blomqvist authored
    The getentropy function, found on Linux, OpenBSD, and recently also
    FreeBSD, can be used to get random bytes to initialize the PRNG.  It
    is similar to the traditional way of reading from /dev/urandom, but
    being a system call rather than a special file, it doesn't suffer from
    problems like running out of file descriptors, or failure when running
    in a container where /dev/urandom may not be available.
    
    Regtested on x86_64-pc-linux-gnu, Ok for trunk?
    
    2018-08-13  Janne Blomqvist  <jb@gcc.gnu.org>
    
    	* configure.ac: Check for getentropy.
    	* intrinsics/random.c (getosrandom): Use getentropy if available.
    	* config.h.in: Regenerated.
    	* configure: Regenerated.
    
    From-SVN: r263522