From 4e09bca9e34c226b6d7e34b4fa11248405fd988e Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Sun, 22 Oct 2023 19:50:38 +0200 Subject: Move everything into a new repo. --- userland/libc/include/stdlib.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 userland/libc/include/stdlib.h (limited to 'userland/libc/include/stdlib.h') 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 +#include +#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 -- cgit v1.2.3