rtc_set_offset(9)
πΈ NAME πΈ
okay bestie, this is rtc_set_offset from the Kernel API Manual β and it adjusts the duration of the average second. iconic behavior, honestly π
β¨
πΈ SYNOPSIS πΈ
int rtc_set_offset (struct rtc_device *rtc , long offset );
πΈ ARGUMENTS πΈ
rtcβ the rtc device to be used π«Άoffsetβ the offset, in parts per billion π
πΈ DESCRIPTION πΈ
some rtc's allow an adjustment to the average duration of a second, bestie. why? to compensate for differences in the actual clock rate due to temperature, the crystal, capacitor, etc. π‘οΈπβ‘
the adjustment applied is literally this:
t = t0 * (1 + offset * 1e-9)
where t0 is the measured length of 1 RTC second with offset = 0 β±οΈβ¨
this is the kernel interface to adjust an rtc clock offset. return 0 on success, or a negative number on error. and if the rtc offset is not setable (or not implemented), return -EINVAL π¨
no cap: negative number = error, and -EINVAL is the "not setable / not implemented" moment π
πΈ SEE ALSO πΈ
kernel file ./drivers/rtc/interface.c β plus the whole squad: rtc_read_next_alarm(9), rtc_handle_legacy_irq(9), rtc_aie_update_irq(9), rtc_uie_update_irq(9), rtc_pie_update_irq(9), rtc_update_irq(9), rtc_irq_set_state(9), rtc_irq_set_freq(9), rtc_timer_enqueue(9), rtc_timer_remove(9), rtc_timer_do_work(9), rtc_read_offset(9) π¦π
source/version is ./drivers/rtc, dated October 2026, and this page is rtc_set_offset(9) β bye bestie, go adjust that average second ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms