stdlib.h 583 B

12345678910111213141516171819202122
  1. /* Minimal freestanding stdlib.h for ring-3 commands. */
  2. #ifndef LIBC_STDLIB_H
  3. #define LIBC_STDLIB_H
  4. #include <stddef.h>
  5. void *malloc(size_t size);
  6. void free(void *ptr);
  7. void *calloc(size_t nmemb, size_t size);
  8. void *realloc(void *ptr, size_t size);
  9. int abs(int value);
  10. int atoi(const char *str);
  11. long atol(const char *str);
  12. long strtol(const char *str, char **endptr, int base);
  13. void qsort(void *base, size_t nmemb, size_t size,
  14. int (*compar)(const void *, const void *));
  15. void exit(int status) __attribute__((noreturn));
  16. void abort(void) __attribute__((noreturn));
  17. #endif