libnvme\_read\_regs(9) libnvme API manual libnvme\_read\_regs(9)

# [NAME](#NAME)

libnvme\_read\_regs - Read the controller registers of a PCIe controller

# [SYNOPSIS](#SYNOPSIS)

**int libnvme\_read\_regs** **(struct libnvme\_transport\_handle \*hdl ,** **\_\_u32 offset ,** **void \*buf ,** **\_\_u32 len );**

# [ARGUMENTS](#ARGUMENTS)

[hdl](#hdl)

Transport handle

[offset](#offset)

Offset of the first register in bytes

[buf](#buf)

Buffer to store the register values

[len](#len)

Number of bytes to read

# [DESCRIPTION](#DESCRIPTION)

Copies the register range [*offset*, *offset* + *len*) of the controller into *buf*, using 32-bit MMIO reads. The register values are stored in little-endian byte order, as they appear in the register map. *offset* and *len* must be multiples of 4 and the range must be within the first 4 KiB of the register map.

This should only be sent to controller handles, not to namespaces.

# [RETURN](#RETURN)

0 on success or a negative error code otherwise. -ENOTSUP indicates that the transport has no memory-mapped registers.

libnvme\_read\_regs October 2026

---

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