diff options
| author | hachem <im@hachem.wtf> | 2026-10-17 12:24:17 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-17 12:24:17 +0200 |
| commit | 20a921db8bd8d5e99c0e9dcc72f22ac00a5e5222 (patch) | |
| tree | 3454816f3642fe468f806aac495c04e55993b102 /sysroot/usr/lib | |
| parent | 6a5543bb8f1f535ca49737bcd7be0cafca3b2a08 (diff) | |
feat: fork/exec & wait
Diffstat (limited to 'sysroot/usr/lib')
| -rw-r--r-- | sysroot/usr/lib/libc/syscalls.c | 20 |
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); +} |
