summaryrefslogtreecommitdiff
path: root/src/stdlib/_stdlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/_stdlib.h')
-rw-r--r--src/stdlib/_stdlib.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/stdlib/_stdlib.h b/src/stdlib/_stdlib.h
new file mode 100644
index 00000000..b0aa3cd2
--- /dev/null
+++ b/src/stdlib/_stdlib.h
@@ -0,0 +1,22 @@
+#ifndef ___STDLIB_H__
+#define ___STDLIB_H__
+
+#include <stdlib.h>
+#include <limits.h>
+
+#define _rand(_n) \
+ (((_n) = (_n) * 1103515245 + 12345) ? (_n) / UINT_MAX % RAND_MAX : 0)
+
+struct __stdlib {
+ struct atexit {
+ int nfns;
+ void (*fns[32])(void);
+ struct atexit *next;
+ struct atexit *prev;
+ } atexit;
+ unsigned int rand;
+};
+
+extern struct __stdlib __stdlib;
+
+#endif