Print this page
9971 Make getrandom(2) a public interface
*** 8,18 ****
* source. A copy of the CDDL is also available via the Internet at
* http://www.illumos.org/license/CDDL.
*/
/*
! * Copyright (c) 2015, Joyent, Inc.
*/
/*
* getentropy(3C) is an OpenBSD compatible wrapper around getrandom(2).
*/
--- 8,18 ----
* source. A copy of the CDDL is also available via the Internet at
* http://www.illumos.org/license/CDDL.
*/
/*
! * Copyright (c) 2018, Joyent, Inc.
*/
/*
* getentropy(3C) is an OpenBSD compatible wrapper around getrandom(2).
*/
*** 21,31 ****
#include <sys/random.h>
int
getentropy(void *buf, size_t buflen)
{
! int ret;
if (buflen > 256) {
errno = EIO;
return (-1);
}
--- 21,31 ----
#include <sys/random.h>
int
getentropy(void *buf, size_t buflen)
{
! ssize_t ret;
if (buflen > 256) {
errno = EIO;
return (-1);
}