Skip to content

Commit c8f988f

Browse files
committed
make sys/random.h inclusion conditional
NetBSD doesn't have it.
1 parent 502450e commit c8f988f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/wasi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <nuttx/config.h>
3434
#endif
3535

36-
#include <sys/random.h> /* getrandom */
3736
#include <sys/socket.h>
3837
#include <sys/stat.h>
3938
#include <sys/time.h>
@@ -53,6 +52,10 @@
5352
#include <time.h>
5453
#include <unistd.h>
5554

55+
#if defined(__GLIBC__) || defined(__NuttX__)
56+
#include <sys/random.h> /* getrandom */
57+
#endif
58+
5659
#include "context.h"
5760
#include "endian.h"
5861
#include "exec.h"

0 commit comments

Comments
 (0)