LibC: add wait and waitpid

Note that wait() doesn't work since only waiting for specified
pid is supported. wait() will just return -1 and set errno to
ECHILD.
This commit is contained in:
2023-06-04 17:59:13 +03:00
parent b68d5a5833
commit cbb9f47ee5
5 changed files with 26 additions and 2 deletions

View File

@@ -137,6 +137,14 @@ long syscall(long syscall, ...)
ret = Kernel::syscall(SYS_REALLOC, (uintptr_t)ptr, size);
break;
}
case SYS_WAIT:
{
pid_t pid = va_arg(args, pid_t);
int* stat_loc = va_arg(args, int*);
int options = va_arg(args, int);
ret = Kernel::syscall(SYS_WAIT, pid, (uintptr_t)stat_loc, options);
break;
}
default:
puts("LibC: Unhandeled syscall");
ret = -ENOSYS;