alarm_try_to_cancel(9)
π alarm_try_to_cancel β a Kernel API Manual moment π
okay so bestie, welcome to the Kernel API Manual, and today's main character is alarm_try_to_cancel(9) β yes, the whole page is named after her, she's that girl. π
β¨ NAME β¨
alarm_try_to_cancel β the function that tries to cancel an alarm timer. emphasis on tries, because sometimes the timer is simply not having it. π
πΈ SYNOPSIS πΈ
int alarm_try_to_cancel (struct alarm *alarm );
like, that's the whole vibe check. one function, one pointer, one int coming back at you. π
π¦ ARGUMENTS π¦
alarmβ ptr to the alarm you want canceled. literally handing her the alarm and being like "ma'am, you're done here" π«Ά
π₯ DESCRIPTION π₯
So here's the tea: alarm_try_to_cancel returns 1 if the timer was canceled β slay, mission accomplished π
It returns 0 if the timer was not running β awkward, there was nothing to cancel, she was already chillin π¬
And it returns -1 if the callback was running β oh no, you caught her mid-glow-up, the callback is already in progress so no canceling that π
that's it. that's the function. three possible outcomes and a whole lot of personality. π
π SEE ALSO π
Kernel file ./kernel/time/alarmtimer.c β go read the source bestie, it's giving lore π§
struct alarm_base(9)alarmtimer_get_rtcdev(9)alarmtimer_enqueue(9)alarmtimer_dequeue(9)alarmtimer_fired(9)alarmtimer_suspend(9)alarm_init(9)alarm_start_timer(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)
yeah that's a lot of friends, she's very social π
and that's the page!! brought to you from ./kernel/time (she lives there π‘), October 2026 edition, and once again the icon herself: alarm_try_to_cancel(9) π bye bestie, go cancel some alarms (or don't, she might be running) π
π¦ 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