mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +00:00
Kernel: Make all syscall functions return KResultOr<T>
This makes it a lot easier to return errors since we no longer have to worry about negating EFOO errors and can just return them flat.
This commit is contained in:
parent
9af1e1a3bf
commit
ac71775de5
70 changed files with 747 additions and 742 deletions
|
@ -38,13 +38,13 @@ KResultOr<siginfo_t> Process::do_waitid(idtype_t idtype, int id, int options)
|
|||
return result;
|
||||
}
|
||||
|
||||
pid_t Process::sys$waitid(Userspace<const Syscall::SC_waitid_params*> user_params)
|
||||
KResultOr<pid_t> Process::sys$waitid(Userspace<const Syscall::SC_waitid_params*> user_params)
|
||||
{
|
||||
REQUIRE_PROMISE(proc);
|
||||
|
||||
Syscall::SC_waitid_params params;
|
||||
if (!copy_from_user(¶ms, user_params))
|
||||
return -EFAULT;
|
||||
return EFAULT;
|
||||
|
||||
switch (params.idtype) {
|
||||
case P_ALL:
|
||||
|
@ -62,7 +62,7 @@ pid_t Process::sys$waitid(Userspace<const Syscall::SC_waitid_params*> user_param
|
|||
return siginfo_or_error.error();
|
||||
|
||||
if (!copy_to_user(params.infop, &siginfo_or_error.value()))
|
||||
return -EFAULT;
|
||||
return EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue