DEVICE_ENABLE(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… DEVICE_ENABLE(9) πŸ’…

okay so bestie, we're in the Kernel Developer's Manual today and this page is literally about the three little functions that flip a device's enabled flag on and off. it's giving "tiny but powerful" energy. πŸŽ€


✨ SYNOPSIS ✨

first things first, you gotta pull in the headers, no cap:

#include <sys/param.h>
#include <sys/bus.h>

and then here are the three icons themselves:

void
device_enable(device_t dev);

void
device_disable(device_t dev);

int
device_is_enabled(device_t dev);

🌸 DESCRIPTION 🌸

okay so picture this: every single device out there has an enabled flag attached to it. that's just how it is. πŸ’…

when a device gets created, it's enabled by default β€” like, automatically, no effort needed, main character energy from day one. ✨ but you can disable it, and honestly there are legit reasons to! for instance, to prevent a destructive or time consuming probe attempt. 😭 yeah. you don't want that happening.

so here's the vibe check on which function does what:

  • device_disable() β€” call this one to disable a device. bye bestie πŸ‘‹
  • device_enable() β€” call this one to re-enable it. welcome back queen πŸ‘‘
  • device_is_enabled() β€” call this one to test whether a device is enabled or not. the vibe check function, fr fr πŸ¦‹

that's it. that's the whole thing. lowkey iconic.


πŸ”₯ SEE ALSO πŸ”₯

  • device(9) β€” go read this one too, iykyk

🫢 AUTHORS 🫢

this manual page was written by Doug Rabson. legend behavior honestly. πŸ’–


Debian πŸ“ June 16, 1998 β€” yeah she's vintage bestie, but she still slays πŸ’€βœ¨ mwah, go enable some devices πŸ§šπŸ’œ

πŸ“¦ where this page comes from