libnvmf\_read\_hostid(9) libnvme API manual libnvmf\_read\_hostid(9)

# [NAME](#NAME)

libnvmf\_read\_hostid - Get the configured host identifier

# [SYNOPSIS](#SYNOPSIS)

**char * libnvmf\_read\_hostid** **(struct libnvme\_global\_ctx \*ctx );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

# [DESCRIPTION](#DESCRIPTION)

Return *ctx*'s hostid default if one is set, otherwise read the identifier from $SYSCONFDIR/nvme/hostid. $SYSCONFDIR is usually /etc. An empty *ctx* default suppresses the file lookup.

This is not the identity a connect uses. See **libnvmf\_host\_get\_ids** for the full resolution order.

# [RETURN](#RETURN)

The host identifier, or NULL if unsuccessful. If found, the caller is responsible to free the string.

libnvmf\_read\_hostid September 2026

---

Document: libnvmf_read_hostid-libnvme3(2) from nvme-cli 3.1-r1 (Chainguard OS)
Source: https://github.com/linux-nvme/nvme-cli
