mirror of https://github.com/mkerrisk/man-pages
getrandom.2: Enhance discussion of /dev/urandom reads in DESCRIPTION
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
652febf0d9
commit
053e5e6914
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue