util: add support for getrandom()

Add support for the Linux getrandom() system call, which is available
in glibc since 2.25.
This commit is contained in:
Miroslav Lichvar
2017-06-15 17:35:33 +02:00
parent db93180ce1
commit c5735ebfe9
3 changed files with 42 additions and 0 deletions

5
configure vendored
View File

@@ -633,6 +633,11 @@ if test_code 'arc4random_buf()' 'stdlib.h' '' '' 'arc4random_buf(NULL, 0);'; the
add_def HAVE_ARC4RANDOM
fi
if test_code 'getrandom()' 'stdlib.h sys/random.h' '' '' \
'getrandom(NULL, 256, 0);'; then
add_def HAVE_GETRANDOM
fi
RECVMMSG_CODE='
struct mmsghdr hdr;
return !recvmmsg(0, &hdr, 1, MSG_DONTWAIT, 0);'