---
name: "pmiSetHostname"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmiSetHostname"
---

# pmiSetHostname(3)

set the source host name for a LOGIMPORT archive

## NAME

**pmiSetHostname** - set the source host name for a LOGIMPORT archive

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**\
 **#include \<pcp/import.h\>**

**int pmiSetHostname(const char \****value***);**

**cc ... -lpcp\_import -lpcp**

## Perl SYNOPSIS

**use PCP::LogImport;**

**pmiSetHostname($***value***);**

## Python SYNOPSIS

**from pcp import pmi**

**log.pmiSetHostname(***value***)**

## DESCRIPTION

As part of the Performance Co-Pilot Log Import API (see [**LOGIMPORT**(3)](/LOGIMPORT/3.md)), **pmiSetHostname** sets the source hostname in the current context to be *value*.

In the absence of a call to **pmiSetHostname** the source hostname defaults to the hostname of the localhost.

## DIAGNOSTICS

**pmiSetHostname** returns zero on success else a negative value that can be turned into an error message by calling [**pmiErrStr**(3)](/pmiErrStr/3.md).

## SEE ALSO

[**LOGIMPORT**(3)](/LOGIMPORT/3.md), [**pmiErrStr**(3)](/pmiErrStr/3.md), [**pmiSetTimezone**(3)](/pmiSetTimezone/3.md), [**pmiSetVersion**(3)](/pmiSetVersion/3.md) and [**pmiStart**(3)](/pmiStart/3.md).
