cdev_del(9)
π cdev_del(9)
okay so we're in the Kernel API Manual, bestie, and today's main character is cdev_del(9). This is the page about removing a cdev from the system β not deleting your group chat, just one char device. Let's get into it π«Ά
β¨ NAME β¨
cdev_del β remove a cdev from the system
πΈ SYNOPSIS πΈ
void cdev_del (struct cdev *p );
π ARGUMENTS π
pβ thecdevstructure to be removed. That's the one getting sent to the group-chat exit, no hard feelings.
π DESCRIPTION π
cdev_del removes p from the system, possibly freeing the structure itself. Yep, possibly β the structure itself might get freed, so don't go assuming anything extra, bestie. π
β οΈ NOTE β οΈ
This guarantees that the cdev device will no longer be able to be opened. Iconic, honestly. π₯
But highkey important: any cdevs already open will remain, and their fops will still be callable even after cdev_del returns. So likeβ¦ no cap, this is not a "close every existing file descriptor for you" situation. Already-open stuff stays open, and its fops stay callable. π«Ά
π SEE ALSO π
Kernel file ./fs/char_dev.c, plus these absolute legends:
register_chrdev_region(9)alloc_chrdev_region(9)__register_chrdev(9)unregister_chrdev_region(9)__unregister_chrdev(9)cdev_add(9)cdev_set_parent(9)cdev_device_add(9)cdev_device_del(9)cdev_alloc(9)cdev_init(9)
that's the whole vibe π¦ this one comes from the ./fs source tree, October 2026 edition β mwah, go touch some char devices (responsibly) π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms