---
name: "libnvmf_exclusion_write-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_exclusion_write-libnvme3"
---

# libnvmf\_exclusion\_write-libnvme3(2)

atomically replace a list's contents.

## NAME

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

## SYNOPSIS

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

## ARGUMENTS

- ctx

  libnvme global context; must not be NULL

- name

  list name

- text

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

- 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

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

## RETURN

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