DEVICE_FIND_CHILD(9)
π DEVICE_FIND_CHILD(9) π
okay bestie, so this is a Kernel Developer's Manual page, section 9, and it's all about device_find_child β literally just searching for a child of a device. that's it, that's the vibe. π¦
β¨ NAME β¨
device_find_child β search for a child of a device π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/bus.h>
device_t
device_find_child(device_t dev, const char *classname, int unit);
like, yes, you gotta pull in both of those headers first, no skipping. π
π DESCRIPTION π
so this function goes looking for a specific child of dev, matching on the given classname and unit. very "i know exactly who i'm looking for" energy. π΅οΈββοΈ
and here's the cute part β if unit is -1, it doesn't need an exact unit match. it just returns the first child of dev with a matching classname β and by "first" we mean the one with the lowest unit. lowest unit wins, periodt. β¨
π RETURN VALUES π
if that child exists, boom, the child device gets returned to you. if not? NULL. that's the whole story. π
fr fr, check for NULL before you go using it, bestie.
π«Ά SEE ALSO π«Ά
π AUTHORS π
this manual page was written by Doug Rabson. iconic of them honestly. π
and that's the whole page!! this one came from the Debian crew, dated February 8, 2005 β so yeah, vintage, but the knowledge still slays. mwah, go find those children, i believe in you ππ
π¦ 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