mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-30 02:28:54 +00:00
libc: consistency of tv_sec when tv_nsec wraps
The libc's internal calculation of the tv_sec and tv_nsec fields must be based on the same ms value. Otherwise, tv_sec is not always immediately incremented whenever tv_nsec wraps. For applications, this inconsistency can result in observed jumps in time. Fixes #5098
This commit is contained in:
parent
684de7a57b
commit
de6048f517
@ -116,7 +116,7 @@ struct Libc::Rtc : Vfs::Watch_response_handler
|
||||
msecs_since_rtc_update.value / 1000;
|
||||
|
||||
result.tv_sec = _rtc_value + seconds_since_rtc_update;
|
||||
result.tv_nsec = (current_msecs.value % 1000) * (1000*1000);
|
||||
result.tv_nsec = (msecs_since_rtc_update.value % 1000) * (1000*1000);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user