diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2018-01-06 23:08:09 +0100 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-02-22 19:34:58 -0500 |
commit | e20658209177667e490c661dfd35b976749ef3f7 (patch) | |
tree | 4cd8f51746279d1b156a6d1a4ea43b46a5dbf537 /include/sys/random.h | |
parent | 9bed82df305f5d1b7ebc36d0ac7a75d4f834e69b (diff) | |
download | musl-e20658209177667e490c661dfd35b976749ef3f7.tar.gz musl-e20658209177667e490c661dfd35b976749ef3f7.tar.xz musl-e20658209177667e490c661dfd35b976749ef3f7.zip |
add getrandom syscall wrapper
This syscall is available since Linux 3.17 and was also implemented in glibc in version 2.25 using the same interfaces.
Diffstat (limited to 'include/sys/random.h')
-rw-r--r-- | include/sys/random.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/sys/random.h b/include/sys/random.h new file mode 100644 index 00000000..4ee7bf2c --- /dev/null +++ b/include/sys/random.h @@ -0,0 +1,19 @@ +#ifndef _SYS_RANDOM_H +#define _SYS_RANDOM_H +#ifdef __cplusplus +extern "C" { +#endif + +#define __NEED_size_t +#define __NEED_ssize_t +#include <bits/alltypes.h> + +#define GRND_NONBLOCK 0x0001 +#define GRND_RANDOM 0x0002 + +ssize_t getrandom(void *, size_t, unsigned); + +#ifdef __cplusplus +} +#endif +#endif |