diff --git a/libs/libglibc-compatibility/CMakeLists.txt b/libs/libglibc-compatibility/CMakeLists.txt index 63a86317252..cfb2f221c97 100644 --- a/libs/libglibc-compatibility/CMakeLists.txt +++ b/libs/libglibc-compatibility/CMakeLists.txt @@ -18,7 +18,8 @@ musl/syscall_ret.c musl/sched_cpucount.c musl/glob.c musl/exp2f.c -musl/pwritev.c) +musl/pwritev.c +musl/getrandom.c) if (MAKE_STATIC_LIBRARIES) set (GLIBC_COMPATIBILITY_SOURCES ${GLIBC_COMPATIBILITY_SOURCES} diff --git a/libs/libglibc-compatibility/musl/getrandom.c b/libs/libglibc-compatibility/musl/getrandom.c new file mode 100644 index 00000000000..070cdb10547 --- /dev/null +++ b/libs/libglibc-compatibility/musl/getrandom.c @@ -0,0 +1,10 @@ +#include +#include +#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); +}