/* * 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 #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 */