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:
Andreas Kling 2021-03-01 13:49:16 +01:00
commit ac71775de5
Notes: sideshowbarker 2024-07-18 21:49:02 +09:00
70 changed files with 747 additions and 742 deletions

View file

@ -160,12 +160,12 @@ static KResultOr<u32> handle_ptrace(const Kernel::Syscall::SC_ptrace_params& par
return KSuccess;
}
int Process::sys$ptrace(Userspace<const Syscall::SC_ptrace_params*> user_params)
KResultOr<int> Process::sys$ptrace(Userspace<const Syscall::SC_ptrace_params*> user_params)
{
REQUIRE_PROMISE(ptrace);
Syscall::SC_ptrace_params params {};
if (!copy_from_user(&params, user_params))
return -EFAULT;
return EFAULT;
auto result = handle_ptrace(params, *this);
return result.is_error() ? result.error().error() : result.value();
}