summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/prng/mrand48.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/prng/mrand48.c')
-rw-r--r--libc-top-half/musl/src/prng/mrand48.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/prng/mrand48.c b/libc-top-half/musl/src/prng/mrand48.c
new file mode 100644
index 0000000..f4a56e6
--- /dev/null
+++ b/libc-top-half/musl/src/prng/mrand48.c
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <inttypes.h>
+#include "rand48.h"
+
+long jrand48(unsigned short s[3])
+{
+ return (int32_t)(__rand48_step(s, __seed48+3) >> 16);
+}
+
+long mrand48(void)
+{
+ return jrand48(__seed48);
+}