libnvmf\_context\_set\_device(9) libnvme API manual libnvmf\_context\_set\_device(9)

# [NAME](#NAME)

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

# [SYNOPSIS](#SYNOPSIS)

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

# [ARGUMENTS](#ARGUMENTS)

[fctx](#fctx)

Fabrics context

[device](#device)

Device path or identifier

# [DESCRIPTION](#DESCRIPTION)

Sets the device to be used by the context.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_context\_set\_device October 2026

---

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