summaryrefslogtreecommitdiff
path: root/klibc/klibc/srand48.c
diff options
context:
space:
mode:
Diffstat (limited to 'klibc/klibc/srand48.c')
-rw-r--r--klibc/klibc/srand48.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/klibc/klibc/srand48.c b/klibc/klibc/srand48.c
new file mode 100644
index 0000000000..a3df16d95c
--- /dev/null
+++ b/klibc/klibc/srand48.c
@@ -0,0 +1,16 @@
+/*
+ * srand48.c
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+
+extern unsigned short __rand48_seed[3];
+
+
+void srand48(long seedval)
+{
+ __rand48_seed[0] = 0x330e;
+ __rand48_seed[1] = (unsigned short)seedval;
+ __rand48_seed[2] = (unsigned short)((uint32_t)seedval >> 16);
+}