---
name: "cpg_membership_get"
section: "3"
platform: "linux"
package: "libcpg-dev"
version: "3.1.9-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cpg_membership_get"
---

# cpg\_membership\_get(3)

Returns a list of members of a CPG group

## NAME

cpg\_membership\_get - Returns a list of members of a CPG group

## SYNOPSIS

**#include \<corosync/cpg.h\>**

**int cpg\_membership\_get(cpg\_handle\_t** *handle***, struct cpg\_name \****groupName***, struct cpg\_address \****member\_list***, int \****member\_list\_entries***);**

## DESCRIPTION

The **cpg\_membership\_get** function is used to determine the current processes in the configuration. You probably will not need to call this function much as one of the first confchg callbacks you will get will be from the cpg\_join() function containing your process. The argument *handle* is used to reference the cpg instantiation. The argument *groupName* will return the name of the group The argument *member\_list* will return the list of processors in the current membership. The argument *member\_list\_entries* should be set with the size of member\_list and will return the size of the member\_list after return from the function.

## ERRORS

The errors are undocumented.

## SEE ALSO

[**cpg\_overview**(3)](/cpg_overview/3.md), [**cpg\_initialize**(3)](/cpg_initialize/3.md), [**cpg\_finalize**(3)](/cpg_finalize/3.md), [**cpg\_fd\_get**(3)](/cpg_fd_get/3.md), [**cpg\_dispatch**(3)](/cpg_dispatch/3.md), [**cpg\_join**(3)](/cpg_join/3.md), [**cpg\_leave**(3)](/cpg_leave/3.md), [**cpg\_mcast\_joined**(3)](/cpg_mcast_joined/3.md), [**cpg\_membership\_get**(3)](/cpg_membership_get/3.md) [**cpg\_zcb\_alloc**(3)](/cpg_zcb_alloc/3.md) [**cpg\_zcb\_free**(3)](/cpg_zcb_free/3.md) [**cpg\_zcb\_mcast\_joined**(3)](/cpg_zcb_mcast_joined/3.md) [**cpg\_context\_get**(3)](/cpg_context_get/3.md) [**cpg\_context\_set**(3)](/cpg_context_set/3.md) [**cpg\_local\_get**(3)](/cpg_local_get/3.md)

**CS\_ERR\_TRY\_AGAIN** Resource temporarily unavailable

**CS\_ERR\_INVALID\_PARAM** Invalid argument

**CS\_ERR\_ACCESS** Permission denied

**CS\_ERR\_LIBRARY** The connection failed

**CS\_ERR\_INTERRUPT** System call interrupted by a signal

**CS\_ERR\_NOT\_SUPPORTED** The requested protocol/functionality not supported

**CS\_ERR\_MESSAGE\_ERROR** Incorrect auth message received

**CS\_ERR\_NO\_MEMORY** Not enough memory to complete the requested task
