CPG_I...ALIZE(3)
π CPG_ITERATION_INITIALIZE β the Corosync Cluster Engine Programmer's Manual, bestie edition π
okay so you're here for cpg_iteration_initialize(3), and honestly? iconic of you. this is the Corosync Cluster Engine Programmer's Manual page and we're gonna get through it together, no cap. β¨
πΈ NAME πΈ
cpg_iteration_initialize β Initialize iterator for members of CPG
π¦ SYNOPSIS π¦
#include <corosync/cpg.h>
cs_error_t cpg_iteration_initialize (cpg_handle_t handle,
cpg_iteration_type_t iteration_type, const struct cpg_name *group,
cpg_iteration_handle_t *cpg_iteration_handle);
π DESCRIPTION π
so the cpg_iteration_initialize function is literally the thing that sets up your iteration over CPG members. like, it's the "get ready to scroll through the list" moment. π«Ά
the handle argument is your connection to the CPG database β you get it by calling cpg_initialize(3). yes, that's the vibe, you need it first.
iteration_type is what limits how many items get returned, and it can be one of these three besties:
CPG_ITERATION_NAME_ONLYβ only the name of used groups are returnedCPG_ITERATION_ONE_GROUPβ only members group with namegroupare returnedCPG_ITERATION_ALLβ all members are returned
the group parameter? it's used only with CPG_ITERATION_ONE_GROUP, and it's the name of the group whose members you want to iterate. for any other iteration_type, this parameter must be NULL. no exceptions, bestie, it's giving strict. π
cpg_iteration_initialize is used only for initialize context for future cpg_iteration_next(3) calls, and the handle that function needs is returned in the cpg_iteration_handle variable. so like, it's the pre-game, not the party itself.
when you have finished iteration over objects, call cpg_iteration_finalize(3) to free up the memory associated with the iteration. clean up after yourself, queen. π
β¨ RETURN VALUE β¨
this call returns the CS_OK value if successful. slay.
if cpg_iteration_handle is NULL, CS_ERR_INVALID_PARAM error is returned. same error is returned when iteration_type is CPG_ITERATION_ONE_GROUP but group is NULL, or when group is not NULL and iteration_type is not CPG_ITERATION_ONE_GROUP. yes, it's checking both directions, it's thorough like that. π
if there is not enough memory for internal store of data, CS_ERR_NO_MEMORY is returned.
CS_ERR_BAD_HANDLE can be returned if handle is not a valid handle.
π₯ COMMON IPC ERRORS π₯
CS_ERR_TRY_AGAINβ Resource temporarily unavailableCS_ERR_INVALID_PARAMβ Invalid argumentCS_ERR_ACCESSβ Permission deniedCS_ERR_LIBRARYβ The connection failedCS_ERR_INTERRUPTβ System call interrupted by a signalCS_ERR_NOT_SUPPORTEDβ The requested protocol/functionality not supportedCS_ERR_MESSAGE_ERRORβ Incorrect auth message receivedCS_ERR_NO_MEMORYβ Not enough memory to complete the requested task
π SEE ALSO π
cpg_iteration_next(3), cpg_iteration_finalize(3), cpg_initialize(3), cpg_overview(3)
and that's the whole page, bestie!! π this was the corosync Man Page, dated 05/03/2012, and if you got this far you're genuinely built different. go forth and iterate responsibly. mwah. πβ¨
π¦ 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) 2012 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms