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