GETENTROPY(3C) Standard C Library Functions GETENTROPY(3C)
getentropy - get entropy
#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(3C).
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(3C) family of functions instead.
Upon successful completion, the value 0 is returned; otherwise the
value -1 is returned and the global variable errno is set to indicate
the error.
getentropy() will succeed unless:
EFAULT The buf parameter points to an invalid address.
EIO Too many bytes requested, or some other fatal error
occurred.
Comitted
MT-LEVEL
Async-Signal-Safe
arc4random(3C), attributes(7)
illumos December 31, 2014 illumos
NAME
getentropy - get entropy
SYNOPSIS
#include <unistd.h>
int
getentropy(void *buf, size_t buflen);
DESCRIPTION
getentropy fills a buffer with high-quality entropy, which can be used
as input for process-context pseudorandom generators like
arc4random(3C).
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(3C) family of functions instead.
RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the
value -1 is returned and the global variable errno is set to indicate
the error.
ERRORS
getentropy() will succeed unless:
EFAULT The buf parameter points to an invalid address.
EIO Too many bytes requested, or some other fatal error
occurred.
INTERFACE STABILITY
Comitted
MT-LEVEL
Async-Signal-Safe
SEE ALSO
arc4random(3C), attributes(7)
illumos December 31, 2014 illumos