GETENTROPY(2) | System Calls Manual | GETENTROPY(2) |
getentropy
—
#include <unistd.h>
int
getentropy
(void
*buf, size_t
buflen);
getentropy
() fills a buffer with high-quality entropy,
which can be used as input for process-context pseudorandom generators like
arc4random(3).
The maximum buffer size permitted is 256 bytes. If
buflen exceeds this, an error of
EIO
will be indicated.
getentropy
() is not intended for regular
code; please use the arc4random(3)
family of functions instead.
getentropy
() will succeed unless:
EFAULT
]EIO
]getentropy
() function appeared in
OpenBSD 5.6.January 31, 2015 | OpenBSD-current |