From 20a921db8bd8d5e99c0e9dcc72f22ac00a5e5222 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 17 Oct 2026 12:24:17 +0200 Subject: feat: fork/exec & wait --- sysroot/usr/lib/libc/syscalls.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sysroot/usr/lib/libc') diff --git a/sysroot/usr/lib/libc/syscalls.c b/sysroot/usr/lib/libc/syscalls.c index ad959b9..33bbb12 100644 --- a/sysroot/usr/lib/libc/syscalls.c +++ b/sysroot/usr/lib/libc/syscalls.c @@ -36,3 +36,23 @@ int brk(void* address) { return (int)__syscall1(SYS_brk, (long)address); } + +int fork(void) +{ + return (int)__syscall0(SYS_fork); +} + +int exec(const char* path, const char* arg) +{ + return (int)__syscall2(SYS_exec, (long)path, (long)arg); +} + +int wait(int* status) +{ + return (int)__syscall1(SYS_wait, (long)status); +} + +int getpid(void) +{ + return (int)__syscall0(SYS_getpid); +} -- cgit v1.3