libnvmf_ker...on_supported(9)
π libnvmf_ker...on_supported(9) β from the libnvme API manual, bestie
okay so picture this: you're in the libnvme API manual, section 9, and you stumble into libnvmf_ker...on_supported. yeah the name is doing the absolute most with those ellipses, but stick with me because this little function is genuinely iconic. β¨
πΈ NAME πΈ
libnvmf_kernel_option_supported β literally just checks if your kernel supports an option. that's it. that's the whole gig. π
π SYNOPSIS π
int libnvmf_kernel_option_supported (struct libnvme_global_ctx *ctx ,
const char *name , bool *supported );
like yes, three arguments, no drama, copy it exactly as written because we do not freestyle signatures around here. π«Ά
π¦ ARGUMENTS π¦
ctxβ your libnvme global context. the main character of the whole libnvme situation tbh. πnameβ the option name, and it has to be spelled exactly how the kernel lists it in/dev/nvme-fabrics. think"discovery","tls","ctrl_loss_tmo". no vibes-based guessing, the strings have to match fr fr. βsupportedβ this is where the answer lands. it gets set totrueif the kernel supportsname. π
β¨ DESCRIPTION β¨
so here's the tea: the options get read from /dev/nvme-fabrics, and that read happens once per ctx. so it's not re-reading every single time, it's caching the vibe check, iykyk. π
β οΈ heads up bestie: that read blocks while another process is busy connecting a controller. so if it feels like it's just sitting there, it's not ghosting you β it's waiting its turn. π
π₯ RETURN π₯
0β success! everything slayed, no notes. π-EINVALβ one of the arguments isNULL. classic. π-EOPNOTSUPPβ the kernel doesn't list its options at all, which is the case on Linux < 5.17. old kernel behaviour, not your fault. π- or honestly any other negative error code, because life finds a way. π§
π little recap because you're my bestie and i want you to win: read once perctx, block on a controller connect, and check your args forNULLbefore you come crying to me about-EINVAL.
and that's the page! brought to you by the libnvme API manual, dated October 2026 β go forth and check those kernel options, you gorgeous nerd. ππβ¨
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms