DOKK / manpages / debian 12 / libnvme-dev / nvme_get_nsid.2.en
nvme_get_nsid(2) libnvme API manual nvme_get_nsid(2)

nvme_get_nsid - Retrieve the NSID from a namespace file descriptor

int nvme_get_nsid (int fd , __u32 *nsid );

File descriptor of nvme namespace
User pointer to namespace id

This should only be sent to namespace handles, not to controllers. The kernel's interface returns the nsid as the return value. This is unfortunate for many architectures that are incapable of allowing distinguishing a namespace id > 0x80000000 from a negative error number.

0 if nsid was set successfully or -1 with errno set otherwise.

nvme_get_nsid January 2023