---
name: "libnvmf_registry_attr_for_each-libnvme3"
section: "2"
platform: "linux"
package: "nvme-cli"
version: "3.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libnvmf_registry_attr_for_each-libnvme3"
---

# libnvmf\_registry\_attr\_for\_each-libnvme3(2)

Iterate over attributes in a controller's registry entry

## NAME

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

## 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

- ctx

  libnvme global context; must not be NULL

- device

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

- callback

  Callback invoked for each attribute

- user\_data

  User data passed to *callback*

## 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

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