---
name: "nvme_write_zeros"
section: "2"
platform: "linux"
package: "libnvme-dev"
version: "1.13-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nvme_write_zeros"
---

# nvme\_write\_zeros(2)

Submit an nvme write zeroes command

## NAME

nvme\_write\_zeros - Submit an nvme write zeroes command

## SYNOPSIS

**int nvme\_write\_zeros** **(struct nvme\_io\_args \*args** *);*

## ARGUMENTS

- args

  *struct nvme\_io\_args* argument structure

## DESCRIPTION

The Write Zeroes command sets a range of logical blocks to zero.  After successful completion of this command, the value returned by subsequent reads of logical blocks in this range shall be all bytes cleared to 0h until a write occurs to this LBA range.

## RETURN

The nvme command status if a response was received (see *enum nvme\_status\_field*) or -1 with errno set otherwise.
