1PMGETCONFIG(3)             Library Functions Manual             PMGETCONFIG(3)
2
3
4

NAME

6       pmGetConfig,  pmGetOptionalConfig,  pmGetAPIConfig  - return values for
7       Performance Co-Pilot configuration variables
8

C SYNOPSIS

10       #include <pcp/pmapi.h>
11
12       char *pmGetConfig(const char *variable);
13       char *pmGetOptionalConfig(const char *variable);
14       char *pmGetAPIConfig(const char *feature);
15
16       cc ... -lpcp
17

DESCRIPTION

19       The pmGetConfig and pmGetOptionalConfig functions search  for  variable
20       first in the environment and then, if not found, in the Performance Co-
21       Pilot (PCP) configuration file and returns the string result.  If vari‐
22       able  is  not  already  in  the environment, it is added with a call to
23       setenv(3) before returning.
24
25       The pmGetOptionalConfig function allows  for  failures  -  either  from
26       variable  not  being set at all, or due to the configuration file being
27       missing.  pmGetConfig is less tolerant to a missing configuration file,
28       which  it  treats  as  a  critical  PCP  installation failure - see the
29       ``RETURN VALUE'' section below for further details.
30
31       The default location of the PCP configuration file is /etc/pcp.conf but
32       this  may  be  changed  by setting PCP_CONF in the environment to a new
33       location, as described in pcp.conf(5).
34
35       The pmGetAPIConfig function reports on features of the PCP library.  It
36       can  be used to query support for multi-threading, security extensions,
37       and other features.
38
39       The pmconfig(1) utility provides command line access to both  of  these
40       interfaces,  and  also  provides  a mechanism for listing all available
41       variables and features that are valid arguments to these routines.
42

RETURN VALUE

44       If variable is not found in either the environment or the PCP  configu‐
45       ration  file,  or if the configuration file is inaccessible, then pmGe‐
46       tOptionalConfig returns NULL.
47
48       If variable is found in neither the environment nor the PCP  configura‐
49       tion  file,  then pmGetConfig returns an empty string.  If the PCP con‐
50       figuration file is not found then a fatal error message is printed  and
51       the process will exit(2) - although this sounds drastic, it is the only
52       course of action available because the  PCP  configuration/installation
53       is deemed fatally flawed.
54
55       The  pmGetAPIConfig  routine  returns  NULL  on  failure  to lookup the
56       requested feature.  It does not modify the environment, and  returns  a
57       pointer to a static read-only string.
58
59       The  value returned by all of these routines is either a static pointer
60       or pointer into the environment, and so changing it is a bad idea.
61

PCP ENVIRONMENT

63       Environment variables with the prefix PCP_ are used to parameterize the
64       file  and  directory names used by PCP.  On each installation, the file
65       /etc/pcp.conf contains the  local  values  for  these  variables.   The
66       $PCP_CONF  variable may be used to specify an alternative configuration
67       file, as described in pcp.conf(5).  Values for these variables  may  be
68       obtained programmatically using the pmGetConfig(3) function.
69

SEE ALSO

71       PCPIntro(1),    pmconfig(1),    pmGetVersion(3),   exit(2),   PMAPI(3),
72       getenv(3), setenv(3), pcp.conf(5), pcp.env(5) and environ(7).
73
74
75
76Performance Co-Pilot                  PCP                       PMGETCONFIG(3)
Impressum