diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-06-07 09:21:42 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-06-07 09:21:42 (GMT) |
commit | dddf4849ec1750ca02d03b9772eff7141ba626f3 (patch) | |
tree | 1add3bb9de96020956ebf0327c163df13af1bb25 /configure | |
parent | 6827fd867b9609c405cd25568aa91df1b0d011b4 (diff) | |
download | cpython-dddf4849ec1750ca02d03b9772eff7141ba626f3.zip cpython-dddf4849ec1750ca02d03b9772eff7141ba626f3.tar.gz cpython-dddf4849ec1750ca02d03b9772eff7141ba626f3.tar.bz2 |
os.urandom() doesn't block on Linux anymore
Issue #26839: On Linux, os.urandom() now calls getrandom() with GRND_NONBLOCK
to fall back on reading /dev/urandom if the urandom entropy pool is not
initialized yet. Patch written by Colm Buckley.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2876,6 +2876,7 @@ fi ac_config_headers="$ac_config_headers pyconfig.h" + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -7568,7 +7569,7 @@ sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ -bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h endian.h \ +bluetooth/bluetooth.h linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \ sys/endian.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -16325,12 +16326,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include <unistd.h> #include <sys/syscall.h> + #include <linux/random.h> int main() { char buffer[1]; const size_t buflen = sizeof(buffer); - const int flags = 0; - /* ignore the result, Python checks for ENOSYS at runtime */ + const int flags = GRND_NONBLOCK; + /* ignore the result, Python checks for ENOSYS and EAGAIN at runtime */ (void)syscall(SYS_getrandom, buffer, buflen, flags); return 0; } |