---
name: "libnvmf_kernel_options_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_kernel_options_for_each-libnvme3"
---

# libnvmf\_kernel\_options\_for\_each-libnvme3(2)

Iterate over the kernel's options

## NAME

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

## SYNOPSIS

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

## ARGUMENTS

- ctx

  libnvme global context

- callback

  Called once per option name

- user\_data

  Caller context passed to *callback*, may be NULL

## DESCRIPTION

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

## RETURN

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