urbit/src/ent.c

19 lines
422 B
C
Raw Normal View History

2018-12-26 06:44:59 +03:00
#include <ent/ent.h>
#if defined __OPENBSD__ || (defined __linux__ && defined _DEFAULT_SOURCE)
# include <unistd.h>
# define getentropy_impl getentropy
#elif defined __APPLE__ && defined __MACH__
2018-12-26 06:49:36 +03:00
# include <unistd.h>
2018-12-26 06:44:59 +03:00
# include <sys/random.h>
# define getentropy_impl getentropy
#else
# error "Port: getentropy unimplemented"
#endif
int
ent_getentropy(void *buf, size_t buflen)
{
return getentropy_impl(buf, buflen);
}