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
dcisNULL? 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
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms