libnvmf\_kernel\_options\_for\_each(9) libnvme API manual libnvmf\_kernel\_options\_for\_each(9)

# [NAME](#NAME)

libnvmf\_kernel\_options\_for\_each - Iterate over the kernel's options

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_kernel\_options\_for\_each** **(struct libnvme\_global\_ctx \*ctx ,** **void (\*callback)(const char \*name, void \*user\_data) ,** **void \*user\_data );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

libnvme global context

[callback](#callback)

Called once per option name

[user\_data](#user_data)

Caller context passed to *callback*, may be NULL

# [DESCRIPTION](#DESCRIPTION)

See **libnvmf\_kernel\_option\_supported** for how the options are read.

# [RETURN](#RETURN)

0 on success, -EINVAL if *ctx* or *callback* is NULL, -EOPNOTSUPP if the kernel does not list its options (Linux &lt; 5.17), or another negative error code.

libnvmf\_kernel\_options\_for\_each October 2026

---

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