---
name: "libnvmf_context_set_devid_file-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_devid_file-libnvme3"
---

# libnvmf\_context\_set\_devid\_file-libnvme3(2)

Set devid file for context

## NAME

libnvmf\_context\_set\_devid\_file - Set devid file for context

## SYNOPSIS

**int libnvmf\_context\_set\_devid\_file** **(struct libnvmf\_context \*fctx** *,* **const char \*devid\_file** *);*

## ARGUMENTS

- fctx

  Fabrics context

- devid\_file

  Path to the output file

## DESCRIPTION

Configure a file that **libnvmf\_connect** uses to record the kernel-assigned device name (for example, "nvme0").

If the controller is already connected, the existing device name is written. Otherwise, the device name is written after the controller is connected.

The output file is created before attempting the connection. If the file cannot be created, for example because the parent directory does not exist, **libnvmf\_connect** fails without attempting the connection.

This is intended for applications that need to identify the device associated with a connection, for example to disconnect it later.

## RETURN

0 on success, negative error code otherwise.
