---
name: "libnvmf_context_set_device-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_context_set_device-libnvme3"
---

# libnvmf\_context\_set\_device-libnvme3(2)

Set device for context

## NAME

libnvmf\_context\_set\_device - Set device for context

## SYNOPSIS

**int libnvmf\_context\_set\_device** **(struct libnvmf\_context \*fctx** *,* **const char \*device** *);*

## ARGUMENTS

- fctx

  Fabrics context

- device

  Device path or identifier

## DESCRIPTION

Sets the device to be used by the context.

## RETURN

0 on success, negative error code otherwise.
