sysfs_remove_dir(9)
π
sysfs_remove_dir β the sysfs manual, section 9, bestie β¨
okay so you're in the Kernel API Manual, section 9, and the function we're stanning today is sysfs_remove_dir. yes it's a kernel thing. yes it's iconic. let's go π«Ά
β¨ SYNOPSIS β¨
void sysfs_remove_dir (struct kobject *kobj );
that's it. that's the whole signature. no return value, she just does the thing π
π ARGUMENTS π
kobjβ the object. that's it, that's the whole description the kernel gave us. just "object." lowkey mysterious of them but okay, we respect the brevity π
π¦ DESCRIPTION π¦
so here's the vibe: the only thing special about this function is that we remove any files in the directory before we remove the directory itself. order matters, bestie β you can't just yank the whole thing and dip π
and btw, the code that used to live in sysfs_rmdir is now inlined below β like, physically inside this function β instead of being called separately as its own little function. so if you were looking for sysfs_rmdir, it's not out here living its own life anymore, it got folded in. it's giving "moved back in with the parents" energy π
no cap: files first, then the directory. that's the whole entire special sauce π
π SEE ALSO π
- Kernel file
./fs/sysfs/dir.c sysfs_create_dir_ns(9)sysfs_create_mount_point(9)sysfs_remove_mount_point(9)
go read those too, iykyk π
aaaand that's the page!! mwah π this came to you from <bold>./fs/sysfs</bold> and it's dated October 2026 β yeah, the future, we're just that ahead of schedule βπ slay, bye π§
π¦ 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