libnvme\_get\_nsid(9) libnvme API manual libnvme\_get\_nsid(9)

# [NAME](#NAME)

libnvme\_get\_nsid - Retrieve the NSID from a namespace file descriptor

# [SYNOPSIS](#SYNOPSIS)

**int libnvme\_get\_nsid** **(struct libnvme\_transport\_handle \*hdl ,** **\_\_u32 \*nsid );**

# [ARGUMENTS](#ARGUMENTS)

[hdl](#hdl)

Transport handle

[nsid](#nsid)

User pointer to namespace id

# [DESCRIPTION](#DESCRIPTION)

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 &gt; 0x80000000 from a negative error number.

# [RETURN](#RETURN)

0 if *nsid* was set successfully or negative error code otherwise.

libnvme\_get\_nsid September 2026

---

Document: libnvme_get_nsid-libnvme3(2) from nvme-cli 3.1-r0 (Chainguard OS)
Source: https://github.com/linux-nvme/nvme-cli
