summaryrefslogtreecommitdiff
path: root/userland/libc/include/stdlib.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-22 19:50:38 +0200
committerAnton Kling <anton@kling.gg>2023-10-22 19:50:38 +0200
commit4e09bca9e34c226b6d7e34b4fa11248405fd988e (patch)
tree80f156b7940d9d19971395f335530170c69516c7 /userland/libc/include/stdlib.h
Move everything into a new repo.
Diffstat (limited to 'userland/libc/include/stdlib.h')
-rw-r--r--userland/libc/include/stdlib.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/userland/libc/include/stdlib.h b/userland/libc/include/stdlib.h
new file mode 100644
index 0000000..c88f2f3
--- /dev/null
+++ b/userland/libc/include/stdlib.h
@@ -0,0 +1,32 @@
+#ifndef STDLIB_H
+#define STDLIB_H
+#include <limits.h>
+#include <stddef.h>
+#define RAND_MAX (UINT32_MAX)
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
+typedef size_t size_t; // only for 32 bit
+
+void *malloc(size_t s);
+void *calloc(size_t nelem, size_t elsize);
+void *realloc(void *ptr, size_t size);
+void free(void *p);
+char *getenv(const char *name);
+int rand(void);
+void srand(unsigned int seed);
+unsigned long strtoul(const char *restrict str, char **restrict endptr,
+ int base);
+long strtol(const char *str, char **restrict endptr, int base);
+void abort(void);
+int abs(int i);
+void qsort(void *base, size_t nel, size_t width,
+ int (*compar)(const void *, const void *));
+int atexit(void (*func)(void));
+int mkstemp(char *template);
+long double strtold(const char *restrict nptr, char **restrict endptr);
+int system(const char *command);
+double atof(const char *str);
+double strtod(const char *restrict nptr, char **restrict endptr);
+int atoi(const char *str);
+#endif