DEVCLASS_GET_DRIVERS(9)

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

πŸ’– DEVCLASS_GET_DRIVERS πŸ’–

okay bestie, welcome to the Kernel Developer's Manual, section 9 β€” this is DEVCLASS_GET_DRIVERS(9) and it's literally all about pulling the driver list out of a devclass ✨

🌸 NAME 🌸

devclass_get_drivers β€” get a list of drivers in a devclass 🫢

✨ SYNOPSIS ✨

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

int
devclass_get_drivers(devclass_t dc, driver_t ***listp, int *countp);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the vibe: devclass_get_drivers() retrieves a list of pointers to all driver instances currently in the devclass πŸ’…. It returns the list in *listp and the number of drivers in the list in *countp β€” iconic, right? πŸ‘‘

The memory allocated for the list should be freed using free(*listp, M_TEMP), even if *countp is 0 😭. Yes, bestie, even when the count is zero β€” don't leave that allocation hanging, fr fr πŸ™ˆ.

⭐ RETURN VALUES ⭐

Zero is returned on success πŸŽ‰; otherwise an appropriate error is returned πŸ’€.

🌈 SEE ALSO 🌈

πŸŽ€ AUTHORS πŸŽ€

This manual page was written by Nate Lawson πŸ‘‘.


xoxo, Debian πŸŽ€ May 19, 2005 πŸŽ€ DEVCLASS_GET_DRIVERS(9) πŸ’…

πŸ“¦ where this page comes from