pmdaDaemon(3) — Linux manual page


PMDADAEMON(3)             Library Functions Manual             PMDADAEMON(3)

NAME         top

       pmdaDaemon - initialize the PMDA to run as a daemon

C SYNOPSIS         top

       #include <pcp/pmapi.h>
       #include <pcp/pmda.h>

       void pmdaDaemon(pmdaInterface *dispatch, int interface, const
               char *name, int domain, const char *logfile, const
               char *helptext);

       cc ... -lpcp_pmda -lpcp

DESCRIPTION         top

       pmdaDaemon initializes the pmdaInterface structure to use the
       interface extensions assuming the PMDA(3) is to be run as a daemon.
       The pmdaInterface structure is initialized with:

       name           The name of the agent.

       domain         The default domain number of the agent which uniquely
                      identifies this PMDA from other running PMDAs.  This
                      may be subsequently changed by a command line option
                      -d (see pmdaGetOpt(3)).

       logfile        The default path to the log file.  This may be
                      replaced by the -l command line option if using
                      pmdaGetOpt.  logfile will be copied with strdup(3), so
                      the storage associated with logfile may be released
                      after the call to pmdaDaemon.

       helptext       The default path to the help text (see pmdaText(3).
                      This may be replaced by the -h command line option if
                      using pmdaGetOpt(3).  If no help text is installed, or
                      you are not using pmdaText(3), then this should be set
                      to NULL, otherwise helptext will be copied with
                      strdup(3), so the storage associated with helptext may
                      be released after the call to pmdaDaemon.

       The callbacks are initialized to pmdaProfile(3), pmdaFetch(3),
       pmdaDesc(3), pmdaText(3), pmdaInstance(3) and pmdaStore(3).

DIAGNOSTICS         top

       Unable to allocate memory for pmdaExt structure
                      In addition, the dispatch->status field is set to a
                      value less than zero.

       PMDA interface version interface not supported
                      The interface version is not supported by pmdaDaemon.

CAVEAT         top

       The PMDA must be using PMDA_INTERFACE_2 or later.

       Once pmdaDaemon has been called, it is expected that the
       pmdaInterface structure pointed to by dispatch will remain accessible
       to the routines in libpcp_pmda (not reclaimed off the stack, not
       freed or oherwise released, etc.).  If the caller needs to move or
       relocate the pmdaInterface structure for any reason, then after the
       move pmdaInterfaceMoved(3) must be called to resestablish the
       internal integrity of the pmdaInterface structure at the new location
       before any other routine in libpcp_pmda is called.

SEE ALSO         top

       PMAPI(3), PMDA(3), pmdaDSO(3), pmdaGetOpt(3), pmdaInterfaceMoved(3)
       and pmdaText(3).

COLOPHON         top

       This page is part of the PCP (Performance Co-Pilot) project.
       Information about the project can be found at ⟨⟩.
       If you have a bug report for this manual page, send it to  This page was obtained from the project's upstream
       Git repository ⟨⟩ on
       2020-09-18.  (At that time, the date of the most recent commit that
       was found in the repository was 2020-09-18.)  If you discover any
       rendering problems in this HTML version of the page, or you believe
       there is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to

Performance Co-Pilot                 PCP                       PMDADAEMON(3)

Pages that refer to this page: pmda(3)PMDA(3)pmdaattribute(3)pmdaAttribute(3)pmdachildren(3)pmdaChildren(3)pmdaCloseHelp(3)pmdaconnect(3)pmdaConnect(3)pmdadesc(3)pmdaDesc(3)pmdadso(3)pmdaDSO(3)pmdaExtGetData(3)pmdaExtSetData(3)pmdaExtSetFlags(3)pmdafetch(3)pmdaFetch(3)pmdaGetHelp(3)pmdaGetInDomHelp(3)pmdaGetOpt(3)pmdagetoptions(3)pmdaGetOptions(3)pmdahelp(3)pmdainit(3)pmdaInit(3)pmdainstance(3)pmdaInstance(3)pmdainterfacemoved(3)pmdaInterfaceMoved(3)pmdalabel(3)pmdaLabel(3)pmdaname(3)pmdaName(3)pmdaOpenHelp(3)pmdaopenlog(3)pmdaOpenLog(3)pmdapmid(3)pmdaPMID(3)pmdaprofile(3)pmdaProfile(3)pmdaRehash(3)pmdaSetCommFlags(3)pmdaSetData(3)pmdaSetFetchCallBack(3)pmdaSetFlags(3)pmdaSetLabelCallBack(3)pmdastore(3)pmdaStore(3)pmdatext(3)pmdaText(3)