getrandom.2: Enhance discussion of /dev/urandom reads in DESCRIPTION

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-01-27 13:23:59 +01:00
parent 652febf0d9
commit 053e5e6914
1 changed files with 14 additions and 1 deletions

View File

@ -65,7 +65,20 @@ This behavior can be changed via the
argument.
If the
.IR /dev/urandom
pool has been initialized, reading from that pool never blocks.
pool has been initialized,
reads of up to 256 bytes will always return as many bytes as
requested and will not be interrupted by signals.
No such guarantees apply for larger buffer sizes.
For example, if the call is interrupted by a signal handler,
it may return a partially filled buffer, or fail with the error
.BR EINTR .
.\" Tested with buffer sizes > 256 bytes: both partial reads
.\" and EINTR can occur, with the former being more frequent.
.\"
.\" mtk: In the absence of signals, in my testing, even very large reads
.\" return full buffers. I found that reads of up to 33554431 always
.\" returned a filled buffer. Specifying 'buflen' > 33554431 always
.\" returned just 33554431 bytes. (I'm not sure where that number comes from.
If the pool has not yet been initialized, then the call blocks, unless
.B GRND_RANDOM
is specified in