summaryrefslogtreecommitdiff
path: root/Libraries/LibC/stdlib.h
diff options
context:
space:
mode:
authorCalvin Buckley <calvin@cmpct.info>2019-10-13 12:26:42 -0300
committerAndreas Kling <awesomekling@gmail.com>2019-10-13 18:03:21 +0200
commitaa42f56210bad3253008de1cbbc7e6cf33e46c7e (patch)
treec586e9e80306a9883cd8e629b316c01852e19955 /Libraries/LibC/stdlib.h
parent7e4e0926533de4ecbd439b7f449a6e77c25b1145 (diff)
downloadserenity-aa42f56210bad3253008de1cbbc7e6cf33e46c7e.zip
LibC: add arc4random* using new getrandom syscall
Serenity is really not production ready; I shouldn't have to warn you not to trust the RNG here. This is for compatibility with software expecting the interface. arc4random does expose an annoying flaw with the syscall I want to discuss with Kling though.
Diffstat (limited to 'Libraries/LibC/stdlib.h')
-rw-r--r--Libraries/LibC/stdlib.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibC/stdlib.h b/Libraries/LibC/stdlib.h
index d3ecc17b14..4301b703b3 100644
--- a/Libraries/LibC/stdlib.h
+++ b/Libraries/LibC/stdlib.h
@@ -54,6 +54,10 @@ void srand(unsigned seed);
long int random();
void srandom(unsigned seed);
+uint32_t arc4random(void);
+void arc4random_buf(void*, size_t);
+uint32_t arc4random_uniform(uint32_t);
+
typedef struct {
int quot;
int rem;