BUS_GENERIC_READ_IVAR(9)

πŸ’– BUS_GENERIC_READ_IVAR πŸ’–

okay bestie so this is a page from the Kernel Developer's Manual, and it's all about bus_generic_read_ivar and bus_generic_write_ivar β€” the generic implementation of BUS_READ_IVAR and BUS_WRITE_IVAR for buses. yes the title is the read one, but they're literally a package deal, you cannot talk about one without the other, they're giving ✨dynamic duo✨ 🫢


✨ NAME ✨

bus_generic_read_ivar, bus_generic_write_ivar β€” generic implementation of BUS_READ_IVAR and BUS_WRITE_IVAR for buses πŸšŒπŸ’…


🌸 SYNOPSIS 🌸

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

int
bus_generic_read_ivar(device_t dev, device_t child, int index,
    uintptr_t *result);

int
bus_generic_write_ivar(device_t dev, device_t child, int index,
    uintptr_t value);

like, copy those includes exactly bestie, don't get creative, sys/param.h and sys/bus.h first, always πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is gonna be the shortest description you have ever read in your life and honestly? iconic of it.

These functions simply return ENOENT. 🫠

that's it. that's the whole thing. no cap. they read the ivar, they write the ivar, and either way they hit you with ENOENT. it's giving "sorry bestie, nothing here" energy and we respect it πŸ’€

ngl this is a building block β€” buses that don't have anything special going on can lean on this as their default behaviour, and drivers that actually care override it with their own BUS_READ_IVAR / BUS_WRITE_IVAR methods. lowkey elegant fr fr 🌈

⭐ SEE ALSO ⭐


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson. thank you Doug, you ate πŸ’…


and that's a wrap bestie!! this page came to you courtesy of Debian, dated January 15, 2017, under the name BUS_GENERIC_READ_IVAR(9). mwah, love u, go read device(9) next πŸ§šπŸ’œ

πŸ“¦ where this page comes from