CPG_JOIN(3)
๐ CPG_JOIN(3) ๐
okay bestie, welcome to cpg_join from the Corosync Cluster Engine Programmer's Manual ๐ธ this is the part of the CPG library where you literally slide into a group's DMs and become a member. it's giving โจnetworkingโจ, it's giving โจbelongingโจ.
โจ NAME โจ
cpg_join โ joins one or more groups in the CPG library ๐
๐ SYNOPSIS ๐
#include <corosync/cpg.h>
int cpg_join(cpg_handle_t handle, struct cpg_name *group);
๐ฆ DESCRIPTION ๐ฆ
so like, the cpg_join function is the one you call to join one group. periodt. ๐ซถ
when a group is joined, cpg_mcast_joined(3) gets called internally to multicast to the groups that were joined in the argument handle. no cap. and your process will also get notifications of other processes joining and leaving the group โ the group chat is live, you're in it, you see everyone coming and going ๐
messages sent to any of the groups joined to the parameter handle will be delivered by cpg_dispatch(3). yes queen, that's your delivery service ๐
โ ๏ธ okay this one matters: this function may only be called once for each handle. one shot, one opportunity, one handle, one join. not me stressing about it ๐ญ
once a group has been joined, the process will start receiving callbacks relating to messages sent from members of the group, plus notifications of processes joining or leaving the group. your phone is now on, notifications enabled, do not disturb OFF ๐
also โ and this is lowkey iconic โ more than one process on each node can join a CPG group, and each one will receive its own copy of any messages sent using cpg_mcast_joined(), and its own confchg callback. everybody gets their own lil treat ๐ no sharing, no fighting, fr fr.
the argument group is used to specify the group to join. it's how you tell the library which group chat you're sliding into ๐
the group argument is of the type struct cpg_name, which is defined by the structure:
struct cpg_name {
int length;
char value[128];
};
look at her. length and a value array of 128 chars. simple. elegant. main character energy ๐
๐ RETURN VALUE ๐
this call returns the CS_OK value if it was successful ๐ and returns CS_ERR_INVALID_PARAM if the handle is already joined to a group โ like bestie you're already in this group chat, why are you knocking again ๐
๐ ERRORS ๐
ngl, not all errors are documented. the devs said "iykyk" and moved on. but here's what we DO know:
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 ๐ง ๐ฅ
๐ SEE ALSO ๐
go read these next, bestie, they're all part of the same lil universe โจ
cpg_overview(3)cpg_initialize(3)cpg_finalize(3)cpg_fd_get(3)cpg_dispatch(3)cpg_join(3)cpg_leave(3)cpg_mcast_joined(3)cpg_membership_get(3)cpg_zcb_alloc(3)cpg_zcb_free(3)cpg_zcb_mcast_joined(3)cpg_context_get(3)cpg_context_set(3)cpg_local_get(3)
and that's the whole page, you ate that ๐
this was the corosync Man Page from 2004-08-31, filed under CPG_JOIN(3) โ mwah, go join a group, you got this ๐๐
๐ฆ where this page comes from
- debian bookworm: libcpg-dev 3.1.7-1+deb12u2 ยท BSD-3-Clause
- debian trixie: libcpg-dev 3.1.9-2+deb13u1 ยท BSD-3-Clause
- epel 9: corosynclib-devel 3.1.10-0.2.el9.1 ยท BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 ยท BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 ยท BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 ยท BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 ยท BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 ยท BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 ยท BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 ยท BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 ยท BSD-3-Clause
- nixos 26.05: corosync 3.1.9
- nixpkgs unstable: corosync 3.1.9
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 ยท BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 ยท BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 ยท BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 ยท BSD-3-Clause
- ubuntu jammy: libcpg-dev 3.1.6-1ubuntu1 ยท BSD-3-Clause
- ubuntu jammy: libcpg-dev 3.1.6-1ubuntu1.2 ยท BSD-3-Clause
- ubuntu noble: libcpg-dev 3.1.7-1ubuntu3 ยท BSD-3-Clause
- ubuntu noble: libcpg-dev 3.1.7-1ubuntu3.2 ยท BSD-3-Clause
- ubuntu questing: libcpg-dev 3.1.9-2ubuntu1
- ubuntu questing: libcpg-dev 3.1.9-2ubuntu1.1
- ubuntu resolute: libcpg-dev 3.1.9-2ubuntu3 ยท BSD-3-Clause
- ubuntu stonking: libcpg-dev 3.1.10-3ubuntu1 ยท BSD-3-Clause
- Copyright (c) 2006 Red Hat, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms