DEVCLASS_GET_DRIVERS(9)

πŸ’– DEVCLASS_GET_DRIVERS πŸ’–

okay bestie, welcome to the Kernel Developer's Manual corner of the internet β€” this one is devclass_get_drivers(9) and it's literally the "hey, who's in this club?" function for your 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 πŸ’…

so basically? you hand it a devclass and it goes and collects a list of pointers to all driver instances currently in the devclass. iconic behaviour, no notes.

it drops that list into *listp πŸ‘‘ and the number of drivers in the list into *countp 🌈

🚨 bestie listen β€” the memory allocated for the list needs to be freed with free(*listp, M_TEMP), and yes, even if *countp is 0. don't skip it just because the count is zero, that's the trap, that's the vibe check you fail πŸ’€

⭐ RETURN VALUES ⭐

Zero is returned on success πŸ’– β€” otherwise, an appropriate error is returned. that's it, that's the deal, fr fr.


πŸ¦‹ SEE ALSO πŸ¦‹

go read those next, iykyk 🌸


πŸŽ€ AUTHORS πŸŽ€

This manual page was written by Nate Lawson. thank you king 🫢✨


mwah β€” this one came from the Debian crew, dated May 19, 2005 (yes, a vintage baddie, we respect the archive πŸ’œ). now go free your list, bestie. no cap. πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from