---
name: "nvme_init_compare-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/nvme_init_compare-libnvme3"
---

# nvme\_init\_compare-libnvme3(2)

Initialize passthru command for a user compare command

## NAME

nvme\_init\_compare - Initialize passthru command for a user compare command

## SYNOPSIS

**void nvme\_init\_compare** **(struct libnvme\_passthru\_cmd \*cmd** *,* **\_\_u32 nsid** *,* **\_\_u64 slba** *,* **\_\_u16 nlb** *,* **\_\_u16 control** *,* **\_\_u8 cev** *,* **void \*data** *,* **\_\_u32 data\_len** *,* **void \*metadata** *,* **\_\_u32 metadata\_len** *);*

## ARGUMENTS

- cmd

  Passthru command to use

- nsid

  Namespace ID

- slba

  Starting logical block

- nlb

  Number of logical blocks (0-based)

- control

  Command control flags, see *enum nvme\_io\_control\_flags*.

- cev

  Command Extension Value (CETYPE is non-zero)

- data

  Pointer to user address of the data buffer

- data\_len

  Length of user buffer, *data*, in bytes

- metadata

  Pointer to user address of the metadata buffer

- metadata\_len

  Length of user buffer, *metadata*, in bytes

## DESCRIPTION

Initializes the passthru command buffer for the Compare command.
