STRUCT ALARM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct alarm(9) πŸŽ€

okay bestie, welcome to section 9 of the Kernel API Manual β€” yes we're in the kernel API girlie corner now, and today's main character is struct alarm, aka the Alarm timer structure ✨


πŸ’– NAME πŸ’–

struct alarm β€” the Alarm timer structure. that's it, that's the vibe. she's a struct, she holds an alarm timer, she slays πŸ’…


🌸 SYNOPSIS 🌸

here's the whole glow-up, copy-pasted exactly because we do NOT mess with code in this house:

struct alarm {
    struct timerqueue_node  node;
    struct hrtimer          timer;
    void (*function)(struct alarm *, ktime_t now);
    enum alarmtimer_type    type;
    int state;
    void *data;
 };

look at her. six members. absolutely iconic. no cap 🫢


πŸ¦‹ Members πŸ¦‹

okay so let's meet the cast, one by one, because every single one of them matters:

  • node β€” the timerqueue node that gets you added to the event list. and plot twist: this value also includes the expiration time. two jobs, one field, main character energy fr fr πŸ‘‘
  • timer β€” the hrtimer that's used to schedule events while things are running. she's the one actually keeping time while the alarm is live ⏰
  • function β€” a function pointer that gets executed when the timer fires. like, the callback. the moment of truth. the "it's happening" moment 😭πŸ”₯
  • type β€” the alarm type, and your options are BOOTTIME / REALTIME. pick your clock, bestie πŸ•°οΈ
  • state β€” a flag that represents whether the alarm is set to fire or not. basically a yes/no girlie for "are we firing or are we not" πŸ’€
  • data β€” internal data value. that's it. that's the description. she's mysterious, she's private, she's internal πŸ™ˆ

🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/alarmtimer.h β€” go read the source, iykyk πŸ“–βœ¨

and that's the whole page!! mwah πŸ’‹

friendly reminder that this beautiful little write-up lives under ./include/linux and it's dated October 2026 β€” so like, mark your calendar, bestie πŸ—“οΈπŸ’œ

stay hydrated, read your headers, and don't forget to #include her πŸ§šβ€β™€οΈπŸŒΈ

πŸ“¦ where this page comes from