STRUCT ALARM_BASE(9)
π struct alarm_base(9) π
okay bestie, buckle up β this one's from the Kernel API Manual, section 9, and it's giving "the actual skeleton of the alarm timer system". no cap, it's lowkey iconic. π
β¨ NAME β¨
struct alarm_base β the alarm timer bases, periodt. that's it, that's the whole vibe. π₯
πΈ SYNOPSIS πΈ
struct alarm_base {
spinlock_t lock;
struct timerqueue_head timerqueue;
ktime_t (*get_ktime)(void);
void (*get_timespec)(struct timespec64 *tp);
clockid_t base_clockid;
};
like, look at her. five members. main character energy. π
π¦ Members π¦
lockβ the spinlock that keeps everything synchronized when people are touching the base at the same time. she's the bouncer at the door, fr fr. πtimerqueueβ astruct timerqueue_headthat manages the actual list of events. this is where all the pending alarms are hanging out. πget_ktimeβ a function pointer that reads the time correlating to this base, and hands it back as aktime_t. β¨get_timespecβ a function pointer that reads the namespace time correlating to the base, writing it into astruct timespec64 *tp. so yes, it returns via the pointer, don't @ me. π«Άbase_clockidβ aclockid_tfor the base. the clock identity. her little name tag. π
π SEE ALSO π
the kernel file lives at ./kernel/time/alarmtimer.c, and honestly the whole friend group is here. all of these, no skips:
alarmtimer_get_rtcdev(9)alarmtimer_enqueue(9)alarmtimer_dequeue(9)alarmtimer_fired(9)alarmtimer_suspend(9)alarm_init(9)alarm_start_timer(9)alarm_try_to_cancel(9)alarm_cancel(9)clock2alarm(9)alarm_handle_timer(9)alarm_timer_rearm(9)alarm_timer_forward(9)alarm_timer_remaining(9)alarm_timer_try_to_cancel(9)alarm_timer_wait_running(9)alarm_timer_arm(9)alarm_clock_getres(9)alarm_clock_get_timespec(9)alarm_clock_get_ktime(9)alarm_timer_create(9)alarmtimer_nsleep_wakeup(9)alarmtimer_do_nsleep(9)alarm_timer_nsleep_restart(9)alarm_timer_nsleep(9)alarmtimer_init(9)
ok that's the whole page, bestie. go read your timers. π§π
and for the cute sign-off: this lil beauty comes from ./kernel/time, dated October 2026 β so go forth and alarm, queen. πβπ
π¦ 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