STRUCT WATCHDOG_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct watchdog_ops(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is the struct watchdog_ops(9) page from the Kernel API Manual, and it's literally the cheat sheet for how a watchdog device does its little tasks. it's all about the lowkey function pointers that actually make the watchdog go. let's get into it ✨


🌸 NAME 🌸

struct watchdog_ops β€” the watchdog-device's operations, aka the whole to-do list for a watchdog driver πŸ•


πŸ¦‹ SYNOPSIS πŸ¦‹

struct watchdog_ops {
    struct module *owner;
    int (*start)(struct watchdog_device *);
    int (*stop)(struct watchdog_device *);
    int (*ping)(struct watchdog_device *);
    unsigned int (*status)(struct watchdog_device *);
    int (*set_timeout)(struct watchdog_device *, unsigned int);
    int (*set_pretimeout)(struct watchdog_device *, unsigned int);
    unsigned int (*get_timeleft)(struct watchdog_device *);
    int (*restart)(struct watchdog_device *, unsigned long, void *);
    long (*ioctl)(struct watchdog_device *, unsigned int, unsigned
long);
 };

bestie this is the whole struct, copied exact, no cap πŸ’–


πŸ‘‘ Members πŸ‘‘

  • owner β€” the module owner. like, who's the main character holding this down 🫢
  • start β€” the routine for starting the watchdog device. it wakes the baby up ✨
  • stop β€” the routine for stopping the watchdog device. nap time 😴
  • ping β€” the routine that sends a keepalive ping to the watchdog device. it's giving "hey bestie I'm still here" πŸ’Œ
  • status β€” the routine that shows the status of the watchdog device. vibe check, but for the hardware πŸ”
  • set_timeout β€” the routine for setting the watchdog devices timeout value (in seconds). ⏰
  • set_pretimeout β€” the routine for setting the watchdog devices pretimeout. the little heads-up before the chaos 🌸
  • get_timeleft β€” the routine that gets the time left before a reset (in seconds). countdown energy πŸ’€
  • restart β€” the routine for restarting the machine. the big red button, iconic πŸ”₯
  • ioctl β€” the routines that handles extra ioctl calls. the bonus side quests 🧚

πŸ’œ Description πŸ’œ

so <pink>the watchdog_ops structure</pink> contains a list of low-level operations that control a watchdog device. it also contains the module that owns these operations.

and here's the part that matters, so listen up πŸ‘‡

the start function is mandatory. all the other functions are optional. periodt.

like β€” start is the main character and everybody else is a supporting cast member. no start, no show 🎬


🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/watchdog.h
  • struct watchdog_device(9)

go read those next, iykyk πŸ¦‹


and that's the page!! source is ./include/linux, dated October 2026, screaming struct watchdog_ops(9) at the top and bottom of the original. mwah, slay, go ping your watchdogs πŸ’…πŸ’–

πŸ“¦ where this page comes from