zig/lib/libc/include/wasm-wasi-musl/sys/random.h
Jakub Konka 7b74de7d71 wasi,cc: fix naming and add stubs for building
Rename include dir to match the convention:
  from `wasm32-wasi` to `wasm-wasi-musl`

Add building stubs which will be used to build and cache WASI
libc sysroot.
2021-05-20 16:54:00 +02:00

27 lines
514 B
C
Vendored

#ifndef _SYS_RANDOM_H
#define _SYS_RANDOM_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __wasilibc_unmodified_upstream /* WASI has no getrandom, but it does have getentropy */
#define __NEED_size_t
#define __NEED_ssize_t
#include <bits/alltypes.h>
#define GRND_NONBLOCK 0x0001
#define GRND_RANDOM 0x0002
#define GRND_INSECURE 0x0004
ssize_t getrandom(void *, size_t, unsigned);
#else
#define __NEED_size_t
#include <bits/alltypes.h>
int getentropy(void *, size_t);
#endif
#ifdef __cplusplus
}
#endif
#endif