mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
Kernel: Make Thread use AK::Time internally
This commit is very invasive, because Thread likes to take a pointer and write to it. This means that translating between timespec/timeval/Time would have been more difficult than just changing everything that hands a raw pointer to Thread, in bulk.
This commit is contained in:
parent
65b36e42b8
commit
2b6546c40a
14 changed files with 66 additions and 82 deletions
|
@ -48,9 +48,7 @@ KResultOr<int> Process::sys$select(Userspace<const Syscall::SC_select_params*> u
|
|||
Optional<Time> timeout_time = copy_time_from_user(params.timeout);
|
||||
if (!timeout_time.has_value())
|
||||
return EFAULT;
|
||||
auto timeout_copy = timeout_time->to_timespec();
|
||||
// FIXME: Should use AK::Time internally
|
||||
timeout = Thread::BlockTimeout(false, &timeout_copy);
|
||||
timeout = Thread::BlockTimeout(false, &timeout_time.value());
|
||||
}
|
||||
|
||||
auto current_thread = Thread::current();
|
||||
|
@ -156,9 +154,7 @@ KResultOr<int> Process::sys$poll(Userspace<const Syscall::SC_poll_params*> user_
|
|||
auto timeout_time = copy_time_from_user(params.timeout);
|
||||
if (!timeout_time.has_value())
|
||||
return EFAULT;
|
||||
timespec timeout_copy = timeout_time->to_timespec();
|
||||
// FIXME: Should use AK::Time internally
|
||||
timeout = Thread::BlockTimeout(false, &timeout_copy);
|
||||
timeout = Thread::BlockTimeout(false, &timeout_time.value());
|
||||
}
|
||||
|
||||
sigset_t sigmask = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue