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

NAME

6       pmdaDaemon - initialize the PMDA to run as a daemon
7

C SYNOPSIS

9       #include <pcp/pmapi.h>
10       #include <pcp/pmda.h>
11
12       void pmdaDaemon(pmdaInterface *dispatch, int interface, const
13               char *name, int domain, const char *logfile, const
14               char *helptext);
15
16       cc ... -lpcp_pmda -lpcp
17

DESCRIPTION

19       pmdaDaemon initializes the pmdaInterface structure to use the interface
20       extensions assuming the PMDA(3) is to be run as a daemon.  The  pmdaIn‐
21       terface structure is initialized with:
22
23       name           The name of the agent.
24
25       domain         The  default  domain  number of the agent which uniquely
26                      identifies this PMDA from other running PMDAs.  This may
27                      be subsequently changed by a command line option -d (see
28                      pmdaGetOpt(3)).
29
30       logfile        The default path to the log file.  This may be  replaced
31                      by the -l command line option if using pmdaGetOpt.  log‐
32                      file will be copied with strdup(3), so the storage asso‐
33                      ciated  with  logfile  may be released after the call to
34                      pmdaDaemon.
35
36       helptext       The default path to  the  help  text  (see  pmdaText(3).
37                      This  may  be  replaced by the -h command line option if
38                      using pmdaGetOpt(3).  If no help text is  installed,  or
39                      you  are  not using pmdaText(3), then this should be set
40                      to  NULL,  otherwise  helptext  will  be   copied   with
41                      strdup(3),  so  the storage associated with helptext may
42                      be released after the call to pmdaDaemon.
43
44       The callbacks are initialized to pmdaProfile(3), pmdaFetch(3),  pmdaDe‐
45       sc(3), pmdaText(3), pmdaInstance(3) and pmdaStore(3).
46

DIAGNOSTICS

48       Unable to allocate memory for pmdaExt structure
49                      In addition, the dispatch->status field is set to a val‐
50                      ue less than zero.
51
52       PMDA interface version interface not supported
53                      The interface version is not supported by pmdaDaemon.
54

CAVEAT

56       The PMDA must be using PMDA_INTERFACE_2 or later.
57
58       Once pmdaDaemon has been called, it is expected that the  pmdaInterface
59       structure pointed to by dispatch will remain accessible to the routines
60       in libpcp_pmda (not reclaimed off the stack, not freed or oherwise  re‐
61       leased,  etc.).  If the caller needs to move or relocate the pmdaInter‐
62       face structure for any  reason,  then  after  the  move  pmdaInterface‐
63       Moved(3)  must  be called to resestablish the internal integrity of the
64       pmdaInterface structure at the new location before any other routine in
65       libpcp_pmda is called.
66

SEE ALSO

68       PMAPI(3), PMDA(3), pmdaDSO(3), pmdaGetOpt(3), pmdaInterfaceMoved(3) and
69       pmdaText(3).
70
71
72
73Performance Co-Pilot                  PCP                        PMDADAEMON(3)
Impressum