Reference

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.