mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 08:45:07 -05:00
configure: disable arc4random on Linux
In glibc 2.36 was added the arc4random family of functions. However, unlike on other supported systems, it is not a user-space PRNG implementation. It just wraps the getrandom() system call with no buffering, which causes a performance loss on NTP servers due to the function being called twice for each response to add randomness to the RX and TX timestamp below the clock precision. Don't check for arc4random on Linux to keep using the buffered getrandom().
This commit is contained in:
8
configure
vendored
8
configure
vendored
@@ -245,6 +245,7 @@ try_lockmem=0
|
|||||||
feat_asyncdns=1
|
feat_asyncdns=1
|
||||||
feat_forcednsretry=1
|
feat_forcednsretry=1
|
||||||
try_clock_gettime=1
|
try_clock_gettime=1
|
||||||
|
try_arc4random=1
|
||||||
try_recvmmsg=1
|
try_recvmmsg=1
|
||||||
feat_timestamping=1
|
feat_timestamping=1
|
||||||
try_timestamping=0
|
try_timestamping=0
|
||||||
@@ -421,6 +422,7 @@ case $OPERATINGSYSTEM in
|
|||||||
try_setsched=1
|
try_setsched=1
|
||||||
try_lockmem=1
|
try_lockmem=1
|
||||||
try_phc=1
|
try_phc=1
|
||||||
|
try_arc4random=0
|
||||||
add_def LINUX
|
add_def LINUX
|
||||||
echo "Configuring for " $SYSTEM
|
echo "Configuring for " $SYSTEM
|
||||||
;;
|
;;
|
||||||
@@ -702,8 +704,10 @@ then
|
|||||||
use_pthread=1
|
use_pthread=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test_code 'arc4random_buf()' 'stdlib.h' '' '' \
|
if [ $try_arc4random = "1" ] && \
|
||||||
'arc4random_buf((void *)1, 1);'; then
|
test_code 'arc4random_buf()' 'stdlib.h' '' '' \
|
||||||
|
'arc4random_buf((void *)1, 1);'
|
||||||
|
then
|
||||||
add_def HAVE_ARC4RANDOM
|
add_def HAVE_ARC4RANDOM
|
||||||
else
|
else
|
||||||
if test_code 'getrandom()' 'stdlib.h sys/random.h' '' '' \
|
if test_code 'getrandom()' 'stdlib.h sys/random.h' '' '' \
|
||||||
|
|||||||
Reference in New Issue
Block a user