pmGetUsername(3)

pmGetUsername3

Fetch special pcp username

C synopsis

#include <pcp/pmapi.h>

int pmGetUsername(char **username);

cc ... -lpcp

Overview

Within the Performance Co-Pilot (PCP) some applications use a special (non-root) username to allow access, e.g. to write log files into protected directories.

pmGetUsername returns the name via username.

The variable name PCP_USER is fetched using pmGetOptionalConfig(3). If this succeeds, pmGetUsername returns 1. Otherwise. username is set to the default value of pcp and pmGetUsername returns 0.

pmGetUsername is most often used in conjunction with pmSetProcessIdentity(3) at process start up.

Releases

5 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11–12
  3. 13
  4. Arch

From pcp 7.2.2-2 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.