Skip to content

Commit

Permalink
Merge pull request #229 from jbeich/freebsd
Browse files Browse the repository at this point in the history
(posix) switch FreeBSD >= 12 to getentropy from libc
  • Loading branch information
letoram committed Mar 3, 2021
2 parents 16e20f2 + 347240c commit 7b29ceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/posix/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int getentropy(void* buf, size_t buflen)
errno = EIO;
return -1;
}
#elif __FreeBSD__
#elif defined(__FreeBSD__) && __FreeBSD__ < 12
#include <sys/sysctl.h>
extern int __sysctl(int*, u_int, void*, size_t*, void*, size_t);
static int getentropy(void* buf, size_t buflen)
Expand All @@ -66,7 +66,7 @@ static int getentropy(void* buf, size_t buflen)
return 0;
}

#elif __OpenBSD__
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#include <unistd.h>
#else
#include <sys/random.h>
Expand Down

0 comments on commit 7b29ceb

Please sign in to comment.