DEVCLASS_GET_MAXUNIT(9)

πŸ’– DEVCLASS_GET_MAXUNIT πŸ’–

okay bestie, welcome to the DEVCLASS_GET_MAXUNIT(9) page from the Kernel Developer's Manual β€” yes it's giving very "I live in /usr/share/man/man9" and honestly? iconic. let's get into it πŸ¦‹


✨ NAME ✨

devclass_get_maxunit β€” find the maximum unit number in the class πŸ‘‘


🌸 SYNOPSIS 🌸

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

int
devclass_get_maxunit(devclass_t dc);

like, that's the whole vibe. one function. one argument. she's simple and she knows it πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea β˜• β€” devclass_get_maxunit() hands you back the next unit number that's gonna be allocated to device instances in the devclass.

and here's the lil plot twist: that number is one greater than the highest unit that's currently allocated. so it's not "the max", it's "the max plus one". we'll get to that. trust. 😭


🫢 RETURN VALUES 🫢

  • if dc is NULL? she returns -1. respectfully. πŸ™ˆ
  • otherwise, she returns the next unit number in dc's devclass ✨

πŸ’€ ERRORS πŸ’€

None. literally none. not a single one. she doesn't do errors, she does results. periodt. πŸ”₯


🌈 SEE ALSO 🌈

go read those too bestie, they're the supporting cast and they ate πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson. we love a credited legend fr fr πŸŽ€


🧚 BUGS 🧚

okay so the name is confusing since it is one greater than the maximum unit. not me warning you about this twice. iykyk πŸ’€

no cap, this is the actual documented bug. the name says "max" but the number is "max + 1". keep that in your notes app bestie πŸ“

that's the whole page!! short, sweet, and lowkey confusing by design πŸ¦‹

signing off from the Debian edition of this manpage, dated September 10, 2010 β€” yeah she's an elder but she still slays πŸ’…βœ¨

πŸ“¦ where this page comes from