Add getrandom.c from musl

This commit is contained in:
alesapin 2018-12-10 21:16:15 +03:00
parent 77c884b7ff
commit ca9d6d83b5
2 changed files with 12 additions and 1 deletions

View File

@ -18,7 +18,8 @@ musl/syscall_ret.c
musl/sched_cpucount.c musl/sched_cpucount.c
musl/glob.c musl/glob.c
musl/exp2f.c musl/exp2f.c
musl/pwritev.c) musl/pwritev.c
musl/getrandom.c)
if (MAKE_STATIC_LIBRARIES) if (MAKE_STATIC_LIBRARIES)
set (GLIBC_COMPATIBILITY_SOURCES ${GLIBC_COMPATIBILITY_SOURCES} set (GLIBC_COMPATIBILITY_SOURCES ${GLIBC_COMPATIBILITY_SOURCES}

View File

@ -0,0 +1,10 @@
#include <unistd.h>
#include <syscall.h>
#include "syscall.h"
ssize_t getrandom(void *buf, size_t buflen, unsigned flags)
{
/// There was cancellable syscall (syscall_cp), but I don't care too.
return syscall(SYS_getrandom, buf, buflen, flags);
}