/* * stdlib.h — general utilities for nulsl-libc. * * The memory functions are ENOSYS stubs until the brk-based allocator * lands; atoi and the exit paths are already real. */ #ifndef _NULSL_STDLIB_H #define _NULSL_STDLIB_H #include #ifdef __cplusplus extern "C" { #endif #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 /* Stubs: brk()/mmap() allocator is on the roadmap. */ void *malloc(size_t size); void *calloc(size_t nmemb, size_t size); void *realloc(void *ptr, size_t size); void free(void *ptr); /* Real. */ void exit(int status); void abort(void); int atoi(const char *s); /* Stub. */ long strtol(const char *s, char **endptr, int base); #ifdef __cplusplus } #endif #endif /* _NULSL_STDLIB_H */