summaryrefslogtreecommitdiff
path: root/kernel/syscalls/randomfill.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/syscalls/randomfill.c')
-rw-r--r--kernel/syscalls/randomfill.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/syscalls/randomfill.c b/kernel/syscalls/randomfill.c
new file mode 100644
index 0000000..41f3ef0
--- /dev/null
+++ b/kernel/syscalls/randomfill.c
@@ -0,0 +1,7 @@
+#include <random.h>
+#include <typedefs.h>
+
+// This syscall will never fail. At worst a page fault will occur but if
+// the syscall returns the buffer will have been filled with random
+// data.
+void syscall_randomfill(void *buffer, u32 size) { get_random(buffer, size); }