mod_timer_pending(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mod_timer_pending(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” this one's mod_timer_pending(9) and it's literally the timer-nerd's bestie. buckle up πŸŽ€


✨ NAME ✨

mod_timer_pending β€” tweak a pending timer's timeout, no cap ⏰


🌸 SYNOPSIS 🌸

int mod_timer_pending (struct timer_list *timer , unsigned long expires );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • timer β€” the pending timer you're about to mess with, iykyk 🫢
  • expires β€” the new absolute timeout, measured in jiffies ⏱️

πŸ’– DESCRIPTION πŸ’–

so like, mod_timer_pending is the exact same energy as mod_timer for pending timers β€” but it will not activate timers that are currently inactive. it's giving "respect the vibe of a sleeping timer" 😴✨

and here's the little detail that matters: if timer->function == NULL, then the start operation is silently discarded. no error, no drama, just... gone πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

  • 0 β€” the timer was inactive and not modified, or it was in a shutdown state and the whole operation was discarded πŸ’€
  • 1 β€” the timer was active and got requeued to expire at expires β€” slay, it worked πŸ‘‘

🌈 SEE ALSO 🌈

go peek at the kernel file ./kernel/time/timer.c and the struct timer_base(9), plus this whole iconic friend group of timer functions:


πŸ’‘ reminder bestie: this only works its magic on pending timers. if your timer's inactive, this function is gonna hit it with the silent treatment fr fr.

and that's the whole page, periodt πŸ’…βœ¨ sourced straight from ./kernel/time, dated October 2026 β€” mwah, go forth and time your timers correctly πŸ§šπŸ’œ

πŸ“¦ where this page comes from