From: Wouter Wijngaards Date: Fri, 20 Feb 2015 09:19:32 +0000 (+0000) Subject: - Use the getrandom syscall introduced in Linux 3.17 (from Heiner Kallweit). X-Git-Tag: release-1.5.3rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=160dd56c4a6dd66000f4b7eab31672d4fa1415e6;p=thirdparty%2Funbound.git - Use the getrandom syscall introduced in Linux 3.17 (from Heiner Kallweit). git-svn-id: file:///svn/unbound/trunk@3338 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/compat/getentropy_linux.c b/compat/getentropy_linux.c index 60e010db7..d4adab285 100644 --- a/compat/getentropy_linux.c +++ b/compat/getentropy_linux.c @@ -93,6 +93,13 @@ getentropy(void *buf, size_t len) return -1; } +#ifdef SYS_getrandom + /* try to use getrandom syscall introduced with kernel 3.17 */ + ret = syscall(SYS_getrandom, buf, len, 0); + if (ret != -1) + return (ret); +#endif /* SYS_getrandom */ + /* * Try to get entropy with /dev/urandom * diff --git a/doc/Changelog b/doc/Changelog index 9b1f98296..41fdab268 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +20 February 2015: Wouter + - Use the getrandom syscall introduced in Linux 3.17 (from Heiner + Kallweit). + 19 February 2015: Wouter - 1.5.2 release tag. - svn trunk contains 1.5.3 under development.