Files
nulsl-libc/include/sys/syscall.h
T
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

52 lines
1.0 KiB
C

/*
* sys/syscall.h — the raw syscall interface.
*
* syscall() is the ONLY place in nulsl-libc that talks the kernel ABI.
* Everything above it (read, write, exit, ...) is a wrapper.
*
* SYS_* constants below are the x86_64 numbers for the syscalls the libc
* itself wraps or its tests use. They are #ifndef-guarded so kernel UAPI
* headers can coexist. Extend the table as needed (docs/syscalls.md).
*/
#ifndef _NULSL_SYS_SYSCALL_H
#define _NULSL_SYS_SYSCALL_H
#ifdef __cplusplus
extern "C" {
#endif
long syscall(long number, ...);
/* x86_64 syscall numbers (Linux ABI). */
#ifndef SYS_read
#define SYS_read 0
#endif
#ifndef SYS_write
#define SYS_write 1
#endif
#ifndef SYS_open
#define SYS_open 2
#endif
#ifndef SYS_close
#define SYS_close 3
#endif
#ifndef SYS_getpid
#define SYS_getpid 39
#endif
#ifndef SYS_exit
#define SYS_exit 60
#endif
#ifndef SYS_unlink
#define SYS_unlink 87
#endif
#ifndef SYS_clock_gettime
#define SYS_clock_gettime 228
#endif
#ifdef __cplusplus
}
#endif
#endif /* _NULSL_SYS_SYSCALL_H */