summaryrefslogtreecommitdiffstats
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-06-11 14:10:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-06-22 15:44:44 +0200
commit738d70e430b0f4cb9ac71d2811b3f6a4c74abbf6 (patch)
tree195b9f1d664b93f77b0daaedb15260222c15d38f /include/stdlib.h
parent600c0e987e3a03c383dfb0c3ffe57c12d366cb1b (diff)
downloadbarebox-738d70e430b0f4cb9ac71d2811b3f6a4c74abbf6.tar.gz
barebox-738d70e430b0f4cb9ac71d2811b3f6a4c74abbf6.tar.xz
include support for a simple pseudo number generator
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
new file mode 100644
index 0000000000..dc720132e8
--- /dev/null
+++ b/include/stdlib.h
@@ -0,0 +1,16 @@
+#ifndef __STDLIB_H
+#define __STDLIB_H
+
+#define RAND_MAX 32767
+
+/* return a pseudo-random integer in the range [0, RAND_MAX] */
+unsigned int rand(void);
+
+/* set the seed for rand () */
+void srand(unsigned int seed);
+
+/* fill a buffer with pseudo-random data */
+void get_random_bytes(char *buf, int len);
+
+
+#endif /* __STDLIB_H */