hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/sysroot/usr/lib/libc/syscalls.c
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-17 12:24:17 +0200
committerhachem <im@hachem.wtf>2026-10-17 12:24:17 +0200
commit20a921db8bd8d5e99c0e9dcc72f22ac00a5e5222 (patch)
tree3454816f3642fe468f806aac495c04e55993b102 /sysroot/usr/lib/libc/syscalls.c
parent6a5543bb8f1f535ca49737bcd7be0cafca3b2a08 (diff)
feat: fork/exec & wait
Diffstat (limited to 'sysroot/usr/lib/libc/syscalls.c')
-rw-r--r--sysroot/usr/lib/libc/syscalls.c20
1 files changed, 20 insertions, 0 deletions
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);
+}