NVME_IDENTIFY_ACTIVE_NS_LIST(2)
β¨ NAME β¨
nvme_identify_active_ns_list β bestie, this one retrieves active namespaces id list π
okay so real quick, we're deep in the libnvme API manual today, and this little function is your girl for finding out which namespaces are actually, you know, alive on your NVMe device. no cap. π¦
πΈ SYNOPSIS πΈ
int nvme_identify_active_ns_list (int fd , __u32 nsid , struct
nvme_ns_list *list );
like, that's the whole vibe. three args, one int coming back at you. iconic. π
π ARGUMENTS π
fdβ the file descriptor of your nvme device. your little handle to the hardware, your main character connection π₯nsidβ "return namespaces greater than this identifier" β so this is your starting point, your cutoff, your "everything above this line bestie" β¨listβ user space destination address to transfer the data. i.e. where you want the goodies dropped off π
π§ DESCRIPTION π§
so here's the tea. β
A list of 1024 namespace IDs gets returned to the host, and it contains NSIDs in increasing order that are greater than the value you specified in the Namespace Identifier (nsid) field of the command. so like, strictly greater-than energy, not equal, not less. slay. π
and if you wanna know exactly what that returned structure is shaped like? go peek at struct nvme_ns_list, that's where the definition lives. iykyk. π«Ά
π RETURN π
What you get back is the nvme command status if a response was received (heads up, see enum nvme_status_field for the deets on that btw π) β or -1 with errno set otherwise. so if it's -1, something went sideways and errno is gonna tell you what. π
lowkey always check the return value, bestie. -1 is not a vibe, it's a warning. π
and that's the whole page fr fr β every arg, every number, every return path, nothing skipped, we ate and left no crumbs π
that's a wrap on this one babes, brought to you by the libnvme API manual, July 2026 edition β go identify some namespaces and stay hydrated πβ¨
π¦ where this page comes from
- ubuntu stonking: libnvme-dev 1.16.2-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms