mirror of https://github.com/mkerrisk/man-pages
getrandom.2: Minor wording fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
dcd72baa13
commit
01a6407427
|
@ -47,7 +47,7 @@ environmental noise.
|
||||||
Unnecessarily reading large quantities of data will have a negative impact
|
Unnecessarily reading large quantities of data will have a negative impact
|
||||||
on other users of the
|
on other users of the
|
||||||
.I /dev/random
|
.I /dev/random
|
||||||
and the
|
and
|
||||||
.I /dev/urandom
|
.I /dev/urandom
|
||||||
devices.
|
devices.
|
||||||
Therefore
|
Therefore
|
||||||
|
@ -70,7 +70,7 @@ The
|
||||||
.I /dev/random
|
.I /dev/random
|
||||||
pool is limited based on the entropy that can be obtained from environmental
|
pool is limited based on the entropy that can be obtained from environmental
|
||||||
noise.
|
noise.
|
||||||
If less random bytes are available than are requested in argument
|
If fewer random bytes are available than are requested in
|
||||||
.IR buflen ,
|
.IR buflen ,
|
||||||
the available random bytes will be copied and the call returns.
|
the available random bytes will be copied and the call returns.
|
||||||
If no random byte is available, the response will depend on the
|
If no random byte is available, the response will depend on the
|
||||||
|
@ -97,7 +97,7 @@ On success,
|
||||||
.BR getrandom ()
|
.BR getrandom ()
|
||||||
returns the number of bytes that were copied to the buffer
|
returns the number of bytes that were copied to the buffer
|
||||||
.IR buf .
|
.IR buf .
|
||||||
This may be less than the bytes requested by the caller via
|
This may be less than the number of bytes requested via
|
||||||
.I buflen
|
.I buflen
|
||||||
if insufficient entropy was present in the
|
if insufficient entropy was present in the
|
||||||
.IR /dev/random
|
.IR /dev/random
|
||||||
|
@ -109,11 +109,11 @@ is set appropriately.
|
||||||
.SH ERRORS
|
.SH ERRORS
|
||||||
.TP
|
.TP
|
||||||
.B EINVAL
|
.B EINVAL
|
||||||
An invalid flag was passed to
|
An invalid flag was specified in
|
||||||
.BR getrandom ().
|
.IR flags .
|
||||||
.TP
|
.TP
|
||||||
.B EFAULT
|
.B EFAULT
|
||||||
The address referenced in parameter
|
The address referred to by
|
||||||
.I buf
|
.I buf
|
||||||
is outside the accessible address space.
|
is outside the accessible address space.
|
||||||
.TP
|
.TP
|
||||||
|
@ -151,13 +151,11 @@ depends on the initialization state of the entropy buffer
|
||||||
and on the request size
|
and on the request size
|
||||||
.IR buflen .
|
.IR buflen .
|
||||||
If the entropy is not yet initialized or the request size is large
|
If the entropy is not yet initialized or the request size is large
|
||||||
.RI ( buflen
|
.RI ( buflen "\ >\ 256),"
|
||||||
> 256),
|
|
||||||
.B EINTR
|
.B EINTR
|
||||||
will be returned.
|
will be returned.
|
||||||
If the entropy pool has been intialized and the request size is small
|
If the entropy pool has been initialized and the request size is small
|
||||||
.RI ( buflen
|
.RI ( buflen "\ <=\ 256),"
|
||||||
<= 256),
|
|
||||||
.BR getrandom ()
|
.BR getrandom ()
|
||||||
will not return
|
will not return
|
||||||
.BR EINTR .
|
.BR EINTR .
|
||||||
|
@ -175,7 +173,7 @@ Calling
|
||||||
.BR getrandom ()
|
.BR getrandom ()
|
||||||
to read
|
to read
|
||||||
.I /dev/urandom
|
.I /dev/urandom
|
||||||
for small values (<= 256) of
|
for small values (<=\ 256) of
|
||||||
.I buflen
|
.I buflen
|
||||||
is the preferred mode of usage.
|
is the preferred mode of usage.
|
||||||
.PP
|
.PP
|
||||||
|
@ -189,8 +187,9 @@ system call.
|
||||||
The user of
|
The user of
|
||||||
.BR getrandom ()
|
.BR getrandom ()
|
||||||
.I must
|
.I must
|
||||||
always check the return value, in case it indicates some error,
|
always check the return value,
|
||||||
or if fewer bytes than requested were returned.
|
to determine whether either an error occurred
|
||||||
|
or fewer bytes than requested were returned.
|
||||||
In the case where
|
In the case where
|
||||||
.B GRND_RANDOM
|
.B GRND_RANDOM
|
||||||
is not specified and
|
is not specified and
|
||||||
|
|
Loading…
Reference in New Issue