1 #ifndef KLIBC_STDLIB_H_
2 #define KLIBC_STDLIB_H_
6 #define abs(x) __builtin_abs(x)
8 int atoi(const char *str);
9 long atol(const char *str);
10 long strtol(const char *str, char **endp, int base);
12 void itoa(int val, char *buf, int base);
13 void utoa(unsigned int val, char *buf, int base);
15 void qsort(void *arr, size_t count, size_t size, int (*cmp)(const void*, const void*));
17 /* defined in malloc.c */
18 void *malloc(size_t sz);
19 void *calloc(size_t num, size_t sz);
20 void *realloc(void *ptr, size_t sz);
23 #endif /* KLIBC_STDLIB_H_ */