CPG_C...XT_SET(3)
π CPG_CONTEXT_SET π
ok so bestie, we're in the Corosync Cluster Engine Programmer's Manual and today's main character is cpg_context_set from section 3 of the manual. yes it's a tiny little function. yes it still deserves a whole glow-up. let's go π
β¨ NAME β¨
cpg_context_set β sets the context variable for a CPG instance π¦
πΈ SYNOPSIS πΈ
#include <corosync/cpg.h>
int cpg_context_set(cpg_handle_t handle, void *context);
like. that's it. that's the whole thing. iconic behavior honestly π
π DESCRIPTION π
so the cpg_context_set function is literally just here to set the context variable for a cpg instance. that's the assignment. that's the mission. slay.
and here's the tea: inside libcpg itself, this thing has no meaning whatsoever. the library will not touch it. it's your little pocket of vibes, completely untouched, living rent-free in the handle. if you wanna get it back later, that's a whole other function β use cpg_context_get(3) π«Ά
π RETURN VALUE π
if everything goes right, this call hands you back the CS_OK value. and if it doesn't? bestie, an error comes back instead. no in-between, no grey area, periodt π
π ERRORS π
ngl the errors are undocumented. that's it. that's the whole section. we don't know and neither does the manpage π
π SEE ALSO π
go read these too, they're all in the same friend group:
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 the error code squad, for when things go sideways:
CS_ERR_TRY_AGAINβ resource temporarily unavailable, she's busy, try again later πCS_ERR_INVALID_PARAMβ invalid argument, bestie that input was NOT it π«CS_ERR_ACCESSβ permission denied, no entry for you πCS_ERR_LIBRARYβ the connection failed, we lost her π΅CS_ERR_INTERRUPTβ system call interrupted by a signal, rude honestly β‘CS_ERR_NOT_SUPPORTEDβ the requested protocol/functionality not supported, we simply don't do that here πCS_ERR_MESSAGE_ERRORβ incorrect auth message received, sus πCS_ERR_NO_MEMORYβ not enough memory to complete the requested task, brain empty, no thoughts π§ π
lowkey reminder bestie: this page is the corosync Man Page, dated 2004-08-31, and it lives under the name CPG_C...XT_SET(3). that's the source, the version, and the date, all wrapped up with a bow πβ¨
go forth and set your context, queen ππ
π¦ 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) 2007 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms