DEVICE_SET_DESC(9)
π DEVICE_SET_DESC(9) β bestie's guide to device descriptions β¨
okay so this is the Kernel Developer's Manual, and we're talking about device_set_desc, device_set_descf, device_set_desc_copy, and device_get_desc β the little squad that handles a device's description. yes bestie, you're gonna be setting and getting desc strings like a main character π
πΈ NAME πΈ
device_set_desc, device_set_descf, device_set_desc_copy, device_get_desc β access the description of a device π
β¨ SYNOPSIS β¨
okay so first the includes, gotta have 'em:
#include <sys/param.h>
#include <sys/bus.h>
then the actual functions, slay:
void
device_set_desc(device_t dev, const char *desc);
void
device_set_descf(device_t dev, const char *fmt, ...);
void
device_set_desc_copy(device_t dev, const char *desc);
const char *
device_get_desc(device_t dev);
π₯ DESCRIPTION π₯
So what we're doing here is manipulating the verbose description of a device β literally its little blurb, its bio, its whole vibe β¨
This description (if it's actually present) gets printed as part of the message when the device is attached during autoconfiguration. so like, it's the thing that shows up in the boot chatter, iconic.
Now the variations, because of course there are variations:
device_set_desc_copy()β use this one when the string you're passing in is a temporary buffer that's gonna get overwritten π In that case the system copies the string for you. Otherwise (with the plaindevice_set_desc()), the pointer you passed is just used directly β no copy, no safety net, fr fr.device_set_descf()β it's the printf-like version ofdevice_set_desc(). so you can format your desc all cute instead of pre-building the string yourself. obsessed π
ngl the pointer-vs-copy distinction is the whole plot here β if your string is temporary and you don't use the _copy version, that's a you problem waiting to happen π
π¦ SEE ALSO π¦
device(9)β go read it, it's the whole context iykyk π«Ά
π AUTHORS π
This manual page was written by Doug Rabson. king behavior, we stan π
and that's the whole page bestie, no cap π this was the Debian edition, dated January 9, 2024 β catch you in the next manpage, mwah πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms