Add public headers

Declarations for the string core, stdio, stdlib, unistd, errno, sys/types, and the raw syscall interface; the FILE layout stays private in src/internal.h.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <[email protected]>
This commit is contained in:
2026-08-30 04:09:45 -04:00
co-authored by Sisyphus
parent 228ed097f0
commit aca40a69b0
7 changed files with 289 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
/*
* 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 <stddef.h>
#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 */