libnvmf\_exclusion\_write(9) libnvme API manual libnvmf\_exclusion\_write(9)

# [NAME](#NAME)

libnvmf\_exclusion\_write - atomically replace a list's contents.

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_exclusion\_write** **(struct libnvme\_global\_ctx \*ctx ,** **const char \*name ,** **const char \*text ,** **uint64\_t version );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

libnvme global context; must not be NULL

[name](#name)

list name

[text](#text)

full replacement contents (every "exclusion = ..." line is validated and must sit inside the \[exclusions] section; invalid entries cause -EINVAL and no write)

[version](#version)

token from a prior **libnvmf\_exclusion\_read**. The write proceeds only if the on-disk list still matches *version*; otherwise it returns -ESTALE and leaves the file untouched, so a concurrent editor's changes are never silently overwritten.

# [DESCRIPTION](#DESCRIPTION)

The replacement is installed atomically (temp file + rename) with mode 0644.

# [RETURN](#RETURN)

0 on success, -ESTALE if the list changed since *version* was read, -EINVAL for an invalid entry or name, negative errno otherwise.

libnvmf\_exclusion\_write October 2026

---

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