stdlib.h 621 B

1234567891011121314151617181920212223
  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. size_t malloc_usable_size(void *ptr);
  8. void *calloc(size_t nmemb, size_t size);
  9. void *realloc(void *ptr, size_t size);
  10. int abs(int value);
  11. int atoi(const char *str);
  12. long atol(const char *str);
  13. long strtol(const char *str, char **endptr, int base);
  14. void qsort(void *base, size_t nmemb, size_t size,
  15. int (*compar)(const void *, const void *));
  16. void exit(int status) __attribute__((noreturn));
  17. void abort(void) __attribute__((noreturn));
  18. #endif