BIO_REGISTER(9)

πŸ“¦ in nixpkgs unstable

πŸ’… BIO_REGISTER(9) β€” bestie's guide to the block I/O ioctl tunnelling interface πŸŽ€

okay so this is the BIO_REGISTER(9) page from the Kernel Developer's Manual, and it's literally about how drivers get their ioctl handlers registered so the bio(4) device can reach them. it's giving backstage-pass energy ✨

🌸 NAME 🌸

bio_register, bio_unregister β€” the block I/O ioctl tunnelling interface. yes that's the whole name, she's long but she's iconic πŸ’–

✨ SYNOPSIS ✨

like always, you gotta bring the header first:

#include <dev/biovar.h>

then the two functions, serving looks:

int
bio_register(struct device *dev,
    int (*bioctl)(struct device *, u_long, caddr_t));

void
bio_unregister(struct device *dev);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the block I/O ioctl tunnelling interface is this whole thing drivers use to register and unregister ioctl handlers, and those handlers get accessed via the bio(4) device. that's the vibe. 🫢

  • bio_register() β€” called by the driver represented by dev to register the bioctl argument as the ioctl handler for itself. it's literally handing over your callback and being like "here, this one's mine, slay" πŸ‘‘
  • bio_unregister() β€” called to remove the ioctl handler that was previously registered with bio_register() for the device represented by dev. it's the unfollow. the goodbye. the "we're done here" πŸ’€

and here's the timing tea β˜•: bio_register() and bio_unregister() can be called during autoconf(9) or from process context. and the bioctl callback? that one is called from process context too. no cap, that's just how she runs. 🌈

ngl, keep that context situation in mind β€” it's the kind of detail that's lowkey important but highkey easy to forget πŸ™ˆ

⭐ SEE ALSO ⭐

go read these next, bestie, they're the supporting cast:

πŸ’œ HISTORY πŸ’œ

the block I/O ioctl tunnelling interface first appeared in OpenBSD 3.2. a true pioneer, an OG, main character energy since day one πŸŽ€

πŸ“ AUTHORS πŸ“

the block I/O ioctl tunnelling interface was written by Niklas Hallqvist <niklas@openbsd.org> β€” we stan a legend πŸ’–βœ¨


and that's the whole page, fr fr 🧚 so much love to the Debian folks for this one β€” source/version Debian, dated September 14, 2015 β€” and to the BIO_REGISTER(9) fam, you ate and left no crumbs πŸ’…πŸ’–

πŸ“¦ where this page comes from
  • nixpkgs unstable: cvs-export
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms