Martin Panter added the comment:

According to <http://man7.org/linux/man-pages/man2/getrandom.2.html>, 
getrandom() returns no more than 32 MiB as an int on Linux. Doesn’t that mean 
you can rely on syscall()’s long return value fitting in an int? Maybe just 
cast n = (int)sycall(...) to be explicit.

But it does make sense to cap n to LONG_MAX just in case there is some strange 
platform where it matters :)

----------
nosy: +martin.panter

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

Reply via email to