CPG_M...P_GET(3)

πŸ’– CPG_MEMBERSHIP_GET β€” bestie's guide to the CPG member list πŸ’–

okay so you're in the Corosync Cluster Engine Programmer's Manual and this is page CPG_M...P_GET(3). yes the header is literally written like that, she's a little mysterious, we love her anyway πŸŽ€


✨ 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 πŸ’…

so cpg_membership_get is the function that tells you which processes are in the configuration right now. that's it, that's the gig ✨

ngl bestie, you probably won't need to call this one much, because one of the very first confchg callbacks you get is gonna come from cpg_join() and it already has your process in it. the function is like, right there at the party before you even ask who's coming πŸ™ˆ

here's the cast of characters:

  • handle β€” your reference to the cpg instantiation. it's the little name tag that says which cpg you're talking about πŸ’–
  • groupName β€” this one returns the name of the group. she's giving you the group's government name πŸ‘‘
  • member_list β€” this one returns the list of processors in the current membership. the whole roster, the whole squad 🌈
  • member_list_entries β€” you set this to the size of member_list before you call, and after the function returns it comes back holding the size of member_list. so she's an in-and-out situation, very main character energy πŸ’…

😭 ERRORS 😭

the errors are undocumented. literally that's all it says. no cap. we know nothing. good luck bestie 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

and then the error-code roster, which lives down here too for some reason, iconic honestly πŸ’œ

  • 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

πŸ’€ real talk: the ERRORS section genuinely just says the errors are undocumented, so don't come for me, I'm only telling you what the page says, fr fr.

that's the whole page bestie, mwah πŸ’‹ this was the corosync Man Page, dated 2006-02-06, filed under CPG_M...P_GET(3). slay, go read cpg_join(3) next, ily πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from