mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
Kernel: Modify TimeManagement::current_time(..) API so it can't fail. (#6869)
The fact that current_time can "fail" makes its use a bit awkward. All callers in the Kernel are trusted besides syscalls, so assert that they never get there, and make sure all current callers perform validation of the clock_id with TimeManagement::is_valid_clock_id(). I have fuzzed this change locally for a bit to make sure I didn't miss any obvious regression.
This commit is contained in:
parent
64b4e3f34b
commit
11306d7121
Notes:
sideshowbarker
2024-07-18 18:41:23 +09:00
Author: https://github.com/bgianfo
Commit: 11306d7121
Pull-request: https://github.com/SerenityOS/serenity/pull/6869
6 changed files with 14 additions and 13 deletions
|
@ -34,7 +34,7 @@ public:
|
|||
static TimeManagement& the();
|
||||
|
||||
static bool is_valid_clock_id(clockid_t);
|
||||
KResultOr<Time> current_time(clockid_t) const;
|
||||
Time current_time(clockid_t) const;
|
||||
Time monotonic_time(TimePrecision = TimePrecision::Coarse) const;
|
||||
Time monotonic_time_raw() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue