---
name: "__pmFindPMDA"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "2.7.4-20080507"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/__pmFindPMDA"
---

# \_\_pmFindPMDA(3)

search for the filename of a PMDA

}

## 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)](/pmcd/1.md), [**PMAPI**(3)](/PMAPI/3.md) and [**pmNewContext**(3)](/pmNewContext/3.md).

## 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)](/dlopen/3.md) or **exec**(2) this file may well fail.
