__ktime_get_real_seconds(9)
π __ktime_get_real_seconds(9) β like, the unprotected clock realtime seconds situation
okay so bestie, we're in the Kernel API Manual today and this one is a whole vibe: it's the feral, no-safety-net cousin of a clock function πβ¨
πΈ NAME πΈ
__ktime_get_real_seconds β unprotected access to CLOCK_REALTIME seconds, no cap π«Ά
β¨ SYNOPSIS β¨
noinstr time64_t __ktime_get_real_seconds (void );
π ARGUMENTS π
voidβ literally no arguments, she takes nothing, she gives seconds π
π DESCRIPTION π
So this is the same as ktime_get_real_seconds but, and hear me out, without the sequence counter protection π That's the whole personality.
She shows up in restricted contexts β like the x86 MCE handler and in KGDB β where, respectfully, you don't have the luxury of doing things the safe way π
The important caveat, and I need you to listen: it's unprotected on 32-bit vs. concurrent half completed modification, and it's only to be used for such critical contexts. That's not a suggestion, that's the rule, periodt π₯
fr fr, do not just casually drop this in normal code. She's for the critical-context girlies only π
β RETURN β
A racy snapshot of the CLOCK_REALTIME seconds value β yes, racy, that's literally the documented behavior, we're not being shady, it's in writing π
π¦ SEE ALSO π¦
the whole extended friend group, iykyk π
- 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_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)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)
and that's the page, bestie!! π§π this icon came to you from the ./kernel/time corner of the source, dated October 2026, living under the Kernel API Manual banner β mwah, slay, go read your timekeeping code responsibly π
π
π¦ 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