---
name: "pmdaDSO"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmdaDSO"
---

# pmdaDSO(3)

initialize the PMDA to run as a DSO

## NAME

**pmdaDSO** - initialize the PMDA to run as a DSO

## C SYNOPSIS

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

**int pmdaDSO(pmdaInterface \****dispatch***,** **int** *interface***,** **char \****name***,** **char \****helptext***);**

**cc ... -lpcp\_pmda -lpcp**

## DESCRIPTION

**pmdaDSO** initializes the **pmdaInterface** structure to use the *interface* extensions, assuming the [**PMDA**(3)](/PMDA/3.md) is to be run as a DSO.  The **pmdaInterface** structure is initialized with:

- *name*

  The name of the agent.

- *helptext*

  The default path to the help text (see [**pmdaText**(3)](/pmdaText/3.md)). If no help text is installed, or you are not using [**pmdaText**(3)](/pmdaText/3.md), then this should be set to NULL, otherwise *helptext* will be copied, so the storage associated with *helptext* may be released after the call to **pmdaDSO**.

The callbacks are initialized to [**pmdaProfile**(3)](/pmdaProfile/3.md), [**pmdaFetch**(3)](/pmdaFetch/3.md), [**pmdaDesc**(3)](/pmdaDesc/3.md), [**pmdaText**(3)](/pmdaText/3.md), [**pmdaInstance**(3)](/pmdaInstance/3.md) and [**pmdaStore**(3)](/pmdaStore/3.md).

The *interface* structure also contains the *domain* of the [**PMDA**(3)](/PMDA/3.md), which is defined in the [**pmcd**(1)](/pmcd/1.md) configuration file. The *domain* is used to initialize the metric and instance descriptors (see [**pmdaInit**(3)](/pmdaInit/3.md)).

## CAVEAT

The PMDA must be using **PMDA\_INTERFACE\_2** or later.

Once **pmdaDSO** 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 otherwise released, etc.). If the caller needs to move or relocate the **pmdaInterface** structure for any reason, then after the move [**pmdaInterfaceMoved**(3)](/pmdaInterfaceMoved/3.md) 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.

## DIAGNOSTICS

- **Incompatible version of pmcd detected**

  When [**pmcd**(1)](/pmcd/1.md) creates the **pmdaInterface** structure, the *dispatch.comm.version* field is set to the highest protocol that [**pmcd**(1)](/pmcd/1.md) understands.  This message indicates that the [**pmcd**(1)](/pmcd/1.md) process does not understand the protocol used by **pmdaDSO**.

- **Unable to allocate memory for pmdaExt structure**

  In addition, *dispatch-\>status* is set to a value less than zero.

## SEE ALSO

[**pmcd**(1)](/pmcd/1.md), [**PMAPI**(3)](/PMAPI/3.md), [**PMDA**(3)](/PMDA/3.md), [**pmdaDaemon**(3)](/pmdaDaemon/3.md), [**pmdaInit**(3)](/pmdaInit/3.md), [**pmdaInterfaceMoved**(3)](/pmdaInterfaceMoved/3.md) and [**pmdaText**(3)](/pmdaText/3.md).
