shithub: tlsclient

ref: 5f5d088f3b4df982a67164526043394648987c68
dir: /libc/genrandom.c/

View raw version
#include <u.h>
#include <libc.h>

#undef long
#undef ulong
#include <unistd.h>
#ifdef __APPLE__
#include <sys/random.h>
#endif

void
genrandom(uchar *buf, int nbytes)
{
	getentropy(buf, nbytes);
}