debugfs_create_bool(9)
β¨ debugfs_create_bool(9) β¨
okay so this is a page from the Kernel API Manual bestie, and it's literally all about one little function that makes a debugfs file that reads and writes a boolean. yes. a bool. true or false. that's the whole vibe. π
πΈ NAME πΈ
debugfs_create_bool β creates a debugfs file that's used to read and write a boolean value π
π¦ SYNOPSIS π¦
void debugfs_create_bool (const char *name , umode_t mode , struct
dentry *parent , bool *value );
that's it. that's the signature. four args, no drama, no cap. β¨
π ARGUMENTS π
okay bestie let's go through these one by one, don't skip, i'm watching π
nameβ a pointer to a string containing the name of the file to create. like, what you're gonna call it. that's the name. iconic behavior honestly.modeβ the permission that the file should have. it's aumode_t, so you know it's the real perms deal π₯parentβ a pointer to the parent dentry for this file. this should be a directory dentry if set. and if this parameter isNULL, then the file gets created in the root of the debugfs filesystem. so like,NULL= main character energy, goes straight to the top π«Άvalueβ a pointer to the variable that the file should read to and write from. so the file and your variable are literally in a situationship. reading and writing. together. π
π DESCRIPTION π
so what does it actually do? okay so β this function creates a file in debugfs with the given name, and that file contains the value of the variable value. simple. clean. slay.
and if the mode variable is so set, it can be read from, and written to. so depending on how you set mode, your lil file is either read-only, write-only, both, whatever β the mode decides, not me. periodt. β
π quick reminder:valueis abool *, so it's pointing at an actualbool. not an int, not a char, not your vibes. a bool.
π§ SEE ALSO π§
like, if you're obsessed with this one (and why wouldn't you be), there's a whole friend group. also the kernel file is ./fs/debugfs/file.c β go look, iykyk π
debugfs_file_get(9)debugfs_file_put(9)debugfs_enter_cancellation(9)debugfs_leave_cancellation(9)debugfs_create_u8(9)debugfs_create_u16(9)debugfs_create_u32(9)debugfs_create_u64(9)debugfs_create_ulong(9)debugfs_create_x8(9)debugfs_create_x16(9)debugfs_create_x32(9)debugfs_create_x64(9)debugfs_create_size_t(9)debugfs_create_atomic_t(9)debugfs_create_str(9)debugfs_create_blob(9)debugfs_create_u32_array(9)debugfs_print_regs32(9)debugfs_create_regset32(9)debugfs_create_devm_seqfile(9)
and that's the page!! π source is ./fs/debugfs, version/date stamp says October 2026, and the whole thing is filed under debugfs_create_bool(9) β mwah, go forth and make bools, bestie πβ¨π¦
π¦ 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