Cory Benfield added the comment:

> But Theodore Ts'o said on the tracker: if you call getrandom() and don't pass 
> in GRND_RANDOM, it's equivalent to /dev/urandom.  So, if getrandom is 
> available, getrandom(flags=0) will always work and never block.

Can we please try to be clear about what kind of blocking we mean? 
getrandom(flags=0) absolutely *can* block: that's what the original issue was 
all about. To ensure it *never* blocks you need to call 
getrandom(GRND_NONBLOCK): that's why the flag exists.

Put another way:

- getrandom(flags=GRND_RANDOM) == /dev/random
- getrandom(flags=GRND_NONBLOCK) == /dev/urandom on Linux
- getrandom(flags=0) == /dev/urandom everywhere but Linux

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27266>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to