shithub: tlsclient

ref: 1241d39d9d60d52d9d17b8f36f8347d41eeda27a
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);
}