Files
huntedbytheirsandSisyphus aca40a69b0 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]>
2026-08-30 04:09:45 -04:00

39 lines
825 B
C

/*
* unistd.h — POSIX system call wrappers for nulsl-libc.
*
* These are thin, real wrappers around the raw syscall() interface — see
* docs/syscalls.md. The kernel is the API; everything else is sugar.
*/
#ifndef _NULSL_UNISTD_H
#define _NULSL_UNISTD_H
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* Real syscall wrappers. */
ssize_t read(int fd, void *buf, size_t count);
ssize_t write(int fd, const void *buf, size_t count);
int close(int fd);
pid_t getpid(void);
void _exit(int status) __attribute__((noreturn));
/* Stub. */
int unlink(const char *path);
/* Raw syscall entry point (also available here for convenience). */
long syscall(long number, ...);
#ifdef __cplusplus
}
#endif
#endif /* _NULSL_UNISTD_H */