libnvme_get_nsid(9) libnvme API manual libnvme_get_nsid(9)

libnvme_get_nsid - Retrieve the NSID from a namespace file descriptor

int libnvme_get_nsid (struct libnvme_transport_handle *hdl , __u32 *nsid );

Transport handle
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 negative error code otherwise.

libnvme_get_nsid September 2026