mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:05:06 -05:00
util: add function to generate random bytes
Add a function to fill a buffer with random bytes which uses a better PRNG than random(). Use arc4random() if it's available on the system. Fall back to reading from /dev/urandom, which should be available on all currently supported systems.
This commit is contained in:
4
configure
vendored
4
configure
vendored
@@ -567,6 +567,10 @@ then
|
||||
MYCFLAGS="$MYCFLAGS -pthread"
|
||||
fi
|
||||
|
||||
if test_code 'arc4random_buf()' 'stdlib.h' '' '' 'arc4random_buf(NULL, 0);'; then
|
||||
add_def HAVE_ARC4RANDOM
|
||||
fi
|
||||
|
||||
timepps_h=""
|
||||
if [ $feat_refclock = "1" ] && [ $feat_pps = "1" ]; then
|
||||
if test_code '<sys/timepps.h>' 'sys/timepps.h' '' '' ''; then
|
||||
|
||||
Reference in New Issue
Block a user