DEVTONAME(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… DEVTONAME(9) β€” like, the whole vibe ✨

okay so real talk: this one is from the Kernel Developer's Manual, section 9, and it's genuinely one of the shortest little slays in the whole kernel docs. no cap, she's tiny but she matters. πŸŽ€


🌸 NAME 🌸

devtoname β€” converts character device into a string indicating the device name πŸ’–

like, you hand her a character device and she hands you back the name as a string. that's the whole gig. iconic behaviour, honestly.


✨ SYNOPSIS ✨

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

const char *
devtoname(struct cdev *dev);

both includes are required, bestie β€” <sys/param.h> and <sys/conf.h>. don't skip either one, i'm begging 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

The devtoname() function returns a pointer to the name of the device passed to it. πŸŽ€

and where does that name come from?? it's whatever was set to it in make_dev(). that's it. that's the tea. make_dev() names the baby, devtoname() tells you the baby's name. 🌈

heads up: she returns a pointer, not a copy β€” so it's referring to the name, not making you a fresh one. πŸ’…

πŸ‘‘ HISTORY πŸ‘‘

The devtoname() interface first appeared in FreeBSD 4.0. ⭐ a legend was born, periodt.


<div align="center">🌸 πŸŽ€ 🌸</div>

and that's the whole page, bestie β€” short, sweet, and absolutely ate. this cutie came to you courtesy of Debian, dated February 10, 2012 πŸ’œ mwah, go name some devices 🧚✨

πŸ“¦ where this page comes from