hrtimer_try_to_cancel(9)
okay so bestie, welcome to the hrtimer_try_to_cancel(9) page from the Kernel API Manual β itβs short, itβs sweet, and itβs literally about trying to deactivate a timer π
β¨
π NAME π
hrtimer_try_to_cancel β try to deactivate a timer. Thatβs the whole assignment, no cap π«Ά
β¨ SYNOPSIS β¨
Copy this exactly, bestie:
int hrtimer_try_to_cancel (struct hrtimer *timer );
πΈ ARGUMENTS πΈ
timerβ thehrtimerto stop. Thatβs it, thatβs the argument π
π DESCRIPTION π
Okay so the vibe check here is the return value, and itβs giving three possible outcomes:
0β when the timer was not active.1β when the timer was active.-1β when the timer is currently executing the callback function and cannot be stopped.
lowkey important: -1 means itβs currently executing the callback function and cannot be stopped. No cap, donβt fight it π
π¦ SEE ALSO π¦
Kernel file ./kernel/time/hrtimer.c β and the whole friend group:
hrtimer_update_function(9)hrtimer_forward(9)hrtimer_start_range_ns(9)hrtimer_start_range_ns_user(9)hrtimer_cancel(9)__hrtimer_get_remaining(9)hrtimer_get_next_event(9)hrtimer_next_event_without(9)hrtimer_setup(9)hrtimer_setup_on_stack(9)hrtimer_sleeper_start_expires(9)hrtimer_setup_sleeper_on_stack(9)
kisses and timer-safe hugs π«Ά β source/version: ./kernel/time Β· date: October 2026 Β· page: hrtimer_try_to_cancel(9) π
π¦ 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