1PMGETCONFIG(3) Library Functions Manual PMGETCONFIG(3)
2
3
4
6 pmGetConfig, pmGetOptionalConfig - return values for Performance Co-
7 Pilot configuration variables
8
10 #include <pcp/pmapi.h>
11 char *pmGetConfig(const char *variable);
12 char *pmGetOptionalConfig(const char *variable);
13
14 #include <pcp/impl.h>
15 char *__pmGetAPIConfig(const char *feature);
16
17 cc ... -lpcp
18
20 The pmGetConfig and pmGetOptionalConfig functions search for variable
21 first in the environment and then, if not found, in the Performance Co-
22 Pilot (PCP) configuration file and returns the string result. If vari‐
23 able is not already in the environment, it is added with a call to
24 putenv(3) before returning.
25
26 The pmGetOptionalConfig function allows for failures - either from
27 variable not being set at all, or due to the configuration file being
28 missing. pmGetConfig is less tolerant to a missing configuration file,
29 which it treats as a critical PCP installation failure - see the
30 ``RETURN VALUE'' section below for further details.
31
32 The default location of the PCP configuration file is /etc/pcp.conf but
33 this may be changed by setting PCP_CONF in the environment to a new
34 location, as described in pcp.conf(5).
35
36 The internal __pmGetAPIConfig function reports on features of the PCP
37 library. It can be used to query support for multi-threading, security
38 extensions, and other features.
39
40 The pmconfig(1) utility provides command line access to both of these
41 interfaces, and also provides a mechanism for listing all available
42 variables and features that are valid arguments to these routines.
43
45 If variable is not found in either the environment or the PCP configu‐
46 ration file, or if the configuration file is inaccessible, then pmGe‐
47 tOptionalConfig returns NULL.
48
49 If variable is found in neither the environment nor the PCP configura‐
50 tion file, then pmGetConfig returns an empty string. If the PCP con‐
51 figuration file is not found then a fatal error message is printed and
52 the process will exit(2) - although this sounds drastic, it is the only
53 course of action available because the PCP configuration/installation
54 is deemed fatally flawed.
55
56 The __pmGetAPIConfig routine returns NULL on failure to lookup the
57 requested feature. It does not modify the environment, and returns a
58 pointer to a static read-only string.
59
60 The value returned by all of these routines is either a static pointer
61 or pointer into the environment, and so changing it is a bad idea.
62
64 Environment variables with the prefix PCP_ are used to parameterize the
65 file and directory names used by PCP. On each installation, the file
66 /etc/pcp.conf contains the local values for these variables. The
67 $PCP_CONF variable may be used to specify an alternative configuration
68 file, as described in pcp.conf(5). Values for these variables may be
69 obtained programmatically using the pmGetConfig(3) function.
70
72 PCPIntro(1), pmconfig(1), pmGetVersion(3), exit(2), PMAPI(3),
73 getenv(3), putenv(3), pcp.conf(5), pcp.env(5) and environ(7).
74
75
76
77Performance Co-Pilot PCP PMGETCONFIG(3)