1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-13 18:32:06 +00:00
serenity/Libraries
Nico Weber 323e727a4c Kernel+LibC: Add adjtime(2)
Most systems (Linux, OpenBSD) adjust 0.5 ms per second, or 0.5 us per
1 ms tick. That is, the clock is sped up or slowed down by at most
0.05%.  This means adjusting the clock by 1 s takes 2000 s, and the
clock an be adjusted by at most 1.8 s per hour.

FreeBSD adjusts 5 ms per second if the remaining time adjustment is
>= 1 s (0.5%) , else it adjusts by 0.5 ms as well. This allows adjusting
by (almost) 18 s per hour.

Since Serenity OS can lose more than 22 s per hour (#3429), this
picks an adjustment rate up to 1% for now. This allows us to
adjust up to 36s per hour, which should be sufficient to adjust
the clock fast enough to keep up with how much time the clock
currently loses. Once we have a fancier NTP implementation that can
adjust tick rate in addition to offset, we can think about reducing
this.

adjtime is a bit old-school and most current POSIX-y OSs instead
implement adjtimex/ntp_adjtime, but a) we have to start somewhere
b) ntp_adjtime() is a fairly gnarly API. OpenBSD's adjfreq looks
like it might provide similar functionality with a nicer API. But
before worrying about all this, it's probably a good idea to get
to a place where the kernel APIs are (barely) good enough so that
we can write an ntp service, and once we have that we should write
a way to automatically evaluate how well it keeps the time adjusted,
and only then should we add improvements ot the adjustment mechanism.
2020-11-10 19:03:08 +01:00
..
LibAudio LibAudio: Use new format functions. 2020-10-17 23:20:31 +02:00
LibC Kernel+LibC: Add adjtime(2) 2020-11-10 19:03:08 +01:00
LibChess LibChess: Forbid King moving into check by a pawn on the home rank 2020-10-30 16:51:41 +01:00
LibCompress Everywhere: Fix typos 2020-10-02 16:03:17 +02:00
LibCore AK: Rename new_out to out and new_warn to warn. 2020-11-09 16:21:29 +01:00
LibCpp LibCpp: Add library for working with c++ code 2020-09-30 21:46:59 +02:00
LibCrypt Everywhere: Port to String::copy_characters_to_buffer() 2020-08-30 17:35:27 +02:00
LibCrypto LibCrypto: Remove spammy ModPow debug log 2020-10-30 23:42:03 +01:00
LibDebug LibDebug: Use move semantics when populating abbreviations map 2020-11-08 23:05:34 +01:00
LibDesktop Meta+LibC through LibHTTP: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LibDiff LibDiff: Add library for working with diffs 2020-09-15 21:43:29 +02:00
LibELF Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
LibGemini LibProtocol+LibGemini+LibHTTP: Provide root certificates to LibTLS 2020-10-30 23:42:03 +01:00
LibGfx LibGfx: Add methods to serialise and deserialise a Bitmap 2020-11-08 21:46:13 +01:00
LibGUI LibGUI: Limit the height of item text in IconView 2020-11-10 09:54:18 +01:00
LibHTTP LibProtocol+LibGemini+LibHTTP: Provide root certificates to LibTLS 2020-10-30 23:42:03 +01:00
LibImageDecoderClient AK: Add trivial structure validation to SharedBuffer 2020-10-02 15:38:07 +02:00
LibIPC LibIPC: Add support for passing around ByteBuffers and HashMap<K, V> 2020-11-08 21:46:13 +01:00
LibJS LibJS: Throw RuntimeError when reaching the end of the stack 2020-11-08 16:51:54 +01:00
LibKeyboard Kernel+LibKeyboard: Store the keymap name when setting system keymap 2020-08-06 17:45:06 +02:00
LibLine Shell+LibLine: Support HISTCONTROL environment variable 2020-10-26 11:27:54 +01:00
LibM Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LibMarkdown LibMarkdown: Use JS::MarkupGenerator for "js" code blocks :^) 2020-10-31 20:52:54 +01:00
LibPCIDB LibPCIDB: Mark compilation-unit-only functions as static 2020-08-12 20:40:59 +02:00
LibProtocol AK: Add trivial structure validation to SharedBuffer 2020-10-02 15:38:07 +02:00
LibPthread Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LibTar Userland: tar: support extracting gzipped files 2020-10-04 00:16:40 +02:00
LibTextCodec LibTextCodec: Mark compilation-unit-only functions as static 2020-08-12 20:40:59 +02:00
LibThread HackStudio: Detach from debugged process before terminating 2020-09-26 17:18:21 +02:00
LibTLS LibTLS: (Almost) verify certificate chain against root CA certificates 2020-10-30 23:42:03 +01:00
LibUnwind Everywhere: Fix typos 2020-10-02 16:03:17 +02:00
LibVT LibVT: Add TerminalWidget::scroll_to_bottom() API 2020-11-10 11:55:12 +01:00
LibWeb LibWeb: Add support for reflected boolean values 2020-11-09 09:51:22 +01:00
LibX86 Everywhere: Redundant inline specifier on constexpr functions (#3807) 2020-10-20 18:08:13 +02:00
CMakeLists.txt LibTar: Create LibTar and TarStream 2020-10-04 00:16:40 +02:00