pmfindpmda(3)

NAME

__pmFindPMDA - search for the filename of a PMDA

C SYNOPSIS

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

char *__pmFindPMDA(const char *name)

cc ... -lpcp

DESCRIPTION

Given the name of a PMDA (may be a DSO PMDA or a daemon PMDA), search for a file of that name in a number of well known places.

If name exists, __pmFindPMDA returns immediately. Otherwise, a search is conducted.

If name is an absolute path (i.e. begins with ``/''), then the only searching involves the equivalence of /usr/pcp/lib and /var/pcp/lib. If name begins with either of these prefixes, then the name formed by translating name to use the other prefix is checked.

If name is a relative path (i.e. does not begin with ``/''), then searching involves scanning each directory in the colon ``:'' separated list defined by the value of the environment variable PMDA_PATH. If PMDA_PATH is not set, the default search path is ``/var/pcp/lib:/usr/pcp/lib''.

The return value is NULL if the search fails, otherwise the path to the PMDA file is returned. For success without searching, the return value is name, otherwise, the return value is the address of a static buffer within __pmFindPMDA.

SEE ALSO

pmcd(1), PMAPI(3) and pmNewContext(3).

CAVEAT

__pmFindPMDA searches for a file base on the supplied name. Success is defined by existence of a file with the matching name, according to the search algorithm. In the case of a successful search, the resultant file may not be a PMDA at all, and a subsequent attempt to dlopen(3) or exec(2) this file may well fail.
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout