logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pmdaDaemon - initialize the PMDA to run as a daemon

C Synopsis

#include<pcp/pmapi.h>#include<pcp/pmda.h>voidpmdaDaemon(pmdaInterface*dispatch,intinterface,constchar*name,intdomain,constchar*logfile,constchar*helptext);cc...-lpcp_pmda-lpcp

Caveat

       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  other‐
       wise  released,  etc.).  If the caller needs to move or relocate the pmdaInterface structure for any rea‐
       son, then after the move pmdaInterfaceMoved(3) must be called to re-establish the internal  integrity  of
       the pmdaInterface structure at the new location before any other routine in libpcp_pmda is called.

Description

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 run‐
                      ning PMDAs.  This may be subsequently changed by a command line  option  -d  (see  pmdaGe‐tOpt(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 com‐
                      mand line option if using pmdaGetOpt(3).  If no help text is installed, or you are not us‐
                      ing 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 pm‐daDaemon.

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

Diagnostics

UnabletoallocatememoryforpmdaExtstructure
                      In addition, the dispatch->status field is set to a value less than zero.

       PMDAinterfaceversioninterfacenotsupported
                      The interface version is not supported by pmdaDaemon.

Name

pmdaDaemon - initialize the PMDA to run as a daemon

See Also

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

Performance Co-Pilot                                   PCP                                         PMDADAEMON(3)

See Also