If the buffer passed to the Linux getrandom(2) system call is longer than 256 bytes, the buffer can be partially written. This happens when the system call is interrupted, which becomes more likely the longer the buffer is.
The current implementation returns an error in this case, when it should just try the call again, attempting to fill the remainder of the buffer.
Thanks to @briansmith's ring implementation, for pointing this out.
If the buffer passed to the Linux
getrandom(2)system call is longer than 256 bytes, the buffer can be partially written. This happens when the system call is interrupted, which becomes more likely the longer the buffer is.The current implementation returns an error in this case, when it should just try the call again, attempting to fill the remainder of the buffer.
Thanks to @briansmith's ring implementation, for pointing this out.