libnvmf\_registry\_attr\_for\_each(9) libnvme API manual libnvmf\_registry\_attr\_for\_each(9)

# [NAME](#NAME)

libnvmf\_registry\_attr\_for\_each - Iterate over attributes in a controller's registry entry

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_registry\_attr\_for\_each** **(struct libnvme\_global\_ctx \*ctx ,** **const char \*device ,** **void (\*callback)(const char \*attr, const char \*value, void \*user\_data) ,** **void \*user\_data );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

libnvme global context; must not be NULL

[device](#device)

Kernel device name (e.g. "nvme3")

[callback](#callback)

Callback invoked for each attribute

[user\_data](#user_data)

User data passed to *callback*

# [DESCRIPTION](#DESCRIPTION)

Opens the registry directory for *device* and invokes *callback* for each attribute file found. Attribute files that disappear during iteration (e.g. because the device is removed concurrently) are silently skipped.

# [RETURN](#RETURN)

0 on success, -ENOENT if the device directory does not exist at the time of the initial open, negative errno otherwise.

libnvmf\_registry\_attr\_for\_each October 2026

---

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