1 #ifndef _SYS_RANDOM_H 2 #define _SYS_RANDOM_H 3 #ifdef __cplusplus 4 extern "C" { 5 #endif 6 7 #ifdef __wasilibc_unmodified_upstream /* WASI has no getrandom, but it does have getentropy */ 8 #define __NEED_size_t 9 #define __NEED_ssize_t 10 #include <bits/alltypes.h> 11 12 #define GRND_NONBLOCK 0x0001 13 #define GRND_RANDOM 0x0002 14 #define GRND_INSECURE 0x0004 15 16 ssize_t getrandom(void *, size_t, unsigned); 17 #else 18 #define __NEED_size_t 19 #include <bits/alltypes.h> 20 21 int getentropy(void *, size_t); 22 #endif 23 24 #ifdef __cplusplus 25 } 26 #endif 27 #endif 28