1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:18:13 +00:00

Kernel: Use UnixDateTime wherever applicable

"Wherever applicable" = most places, actually :^), especially for
networking and filesystem timestamps.

This includes changes to unzip, which uses DOSPackedTime, since that is
changed for the FAT file systems.
This commit is contained in:
kleines Filmröllchen 2023-03-13 22:11:13 +01:00 committed by Jelle Raaijmakers
parent c1323febc2
commit 939600d2d4
41 changed files with 115 additions and 125 deletions

View file

@ -329,10 +329,11 @@ ErrorOr<u32> Controller::get_pcm_output_sample_rate(size_t channel_index)
ErrorOr<void> wait_until(size_t delay_in_microseconds, size_t timeout_in_microseconds, Function<ErrorOr<bool>()> condition)
{
auto const& time_management = TimeManagement::the();
u64 start_microseconds = time_management.now().to_microseconds();
// FIXME: Use monotonic time instead.
u64 start_microseconds = time_management.now().offset_to_epoch().to_microseconds();
while (!TRY(condition())) {
microseconds_delay(delay_in_microseconds);
if ((time_management.now().to_microseconds() - start_microseconds) >= timeout_in_microseconds)
if ((time_management.now().offset_to_epoch().to_microseconds() - start_microseconds) >= timeout_in_microseconds)
return ETIMEDOUT;
}
return {};