ktime_get_snapshot_id(9)
β¨ ktime_get_snapshot_id(9) β¨
okay so bestie, welcome to the Kernel API Manual π«Ά this one is from ktime_get_snapshot_id(9) and it is literally the "grab everything at once" of clock functions π
πΈ NAME πΈ
ktime_get_snapshot_id β simultaneously snapshot a given clock ID together with the corresponding monotonic raw clock and the underlying clocksource counter value β±οΈβ¨ like, all at the same time, no cap.
π SYNOPSIS π
void ktime_get_snapshot_id (clockid_t clock_id , struct system_time_snapshot *systime_snapshot );
π¦ ARGUMENTS π¦
clock_idβ the clock ID you wanna snapshot π that's the one, babes.systime_snapshotβ pointer to thestructthat's receiving the system time snapshot π it's giving "here's your data, bestie".
π DESCRIPTION π
so for the system timekeeping clocks β that's REALTIME, MONOTONIC and BOOTTIME β the monotonic raw clock is CLOCK_MONOTONIC_RAW π iconic behaviour, honestly.
for AUX clocks, it's the monotonic raw clock that's related to the AUX clock. and these AUX-clock-related monotonic raw clocks have a strict linear offset to the system time CLOCK_MONOTONIC_RAW β¨ math time:
MONOTONIC_RAW(AUX$N) = CLOCK_MONOTONIC_RAW(system) + offset(AUX$N)
the offset gets established when an AUX clock is initialized π but β and this is the part where we sigh β it is currently not accessible π like the info is just vibing there behind the glass, not for us. π
π₯ SEE ALSO π₯
literally the whole timekeeping friend group, go say hi π
- Kernel file
./kernel/time/timekeeping.c 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)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)ktime_get_update_offsets_now(9)random_get_entropy_fallback(9)do_adjtimex(9)hardpps(9)ktime_get_aux(9)ktime_get_aux_ts64(9)
alright bestie, that's the whole thing, mwah π this page lives in ./kernel/time and the version vibes are dated October 2026 β until then, stay snapshotted, stay iconic ππ
π¦ 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