ktime_get_up..._offsets_now(9)
π ktime_get_up..._offsets_now β Kernel API Manual
okay bestie, so this is ktime_get_update_offsets_now(9) from the Kernel API Manual, and she's a lil hrtimer helper π β like, the name in the header is literally truncated with ... because it's too iconic to fit. let's get into it π
β¨ SYNOPSIS β¨
ktime_t ktime_get_update_offsets_now (u32 *cwsseq , ktime_t *offs_real ,
ktime_t *offs_boot , ktime_t *offs_tai );
look at her π four pointers, one ktime_t return, zero notes. she's booked and busy.
π«Ά ARGUMENTS π«Ά
cwsseqβ pointer to check and store the clock was set sequence number. literally "clock was set seq", iykyk.offs_realβ pointer to storage for the monotonic -> realtime offset.offs_bootβ pointer to storage for the monotonic -> boottime offset.offs_taiβ pointer to storage for the monotonic -> clock tai offset.
four pointers, no cap. she wants to know where you're storing stuff π
πΈ DESCRIPTION πΈ
so what does she actually do? she returns the current monotonic time, and she updates those offsets β but only if the sequence number in cwsseq and timekeeper.clock_was_set_seq are different. like, vibe check first, updates second π
not me comparing sequence numbers before doing anything β she's got boundaries.
and where's she called from? hrtimer_interrupt or retrigger_next_event. so yeah, she lives in the interrupt-y part of town π«Ά
π¦ SEE ALSO π¦
the whole friend group, in the order the page gives them, no skips (we do not skip, periodt):
struct tk_fast(9)tk_setup_internals(9)update_fast_timekeeper(9)ktime_get_mono_fast_ns(9)ktime_get_raw_fast_ns(9)ktime_get_boot_fast_ns(9)ktime_get_tai_fast_ns(9)ktime_get_real_fast_ns(9)halt_fast_timekeeper(9)pvclock_gtod_register_notifier(9)pvclock_gtod_unregister_notifier(9)timekeeping_forward_now(9)ktime_get_real_ts64(9)ktime_mono_to_any(9)ktime_get_raw(9)ktime_get_ts64(9)ktime_get_seconds(9)ktime_get_real_seconds(9)__ktime_get_real_seconds(9)ktime_get_snapshot_id(9)adjust_historical_crosststamp(9)ktime_real_to_base_clock(9)get_device_system_crosststamp(9)timekeeping_clocksource_has_base(9)do_settimeofday64(9)__timekeeping_inject_offset(9)timekeeping_notify(9)ktime_get_raw_ts64(9)timekeeping_valid_for_hres(9)timekeeping_max_deferment(9)read_persistent_clock64(9)read_persistent_wall_and_boot_offset(9)__timekeeping_inject_sleeptime(9)timekeeping_inject_sleeptime64(9)timekeeping_resume(9)update_wall_time(9)getboottime64(9)ktime_get_coarse_real_ts64_mg(9)ktime_get_real_ts64_mg(9)random_get_entropy_fallback(9)do_adjtimex(9)hardpps(9)ktime_get_aux(9)ktime_get_aux_ts64(9)
and the source she lives in? that's ./kernel/time/timekeeping.c π§
that's the whole page, bestie β every flag, every pointer, every one of those 44 see-alsos, all of it. slay β¨
signed off with love from ./kernel/time π datestamped October 2026 π β mwah, go read timekeeping.c π
π¦ 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