CPG_LOCAL_GET(3)

πŸ’– CPG_LOCAL_GET πŸ’–

okay so bestie, welcome to the Corosync Cluster Engine Programmer's Manual page for cpg_local_get β€” yes it's a section 3 (library calls) situation, and yes it's about to be your new fave little function. it's giving "who am I" but for nodes. let's go πŸ¦‹


✨ NAME ✨

cpg_local_get β€” returns the local node id πŸ‘‘


🌸 SYNOPSIS 🌸

#include <corosync/cpg.h>

int cpg_local_get(cpg_handle_t handle, unsigned int *local_nodeid);

πŸ’… DESCRIPTION πŸ’…

so the cpg_local_get function is literally the "hey, what's my node id?" function. you use it to determine the local node's identifier. no cap. 🫢

the argument handle is what references the cpg instantiation β€” it's your lil VIP pass to the cpg world, so hand it over exactly like that.

and the argument local_nodeid? that's where the good stuff comes out: it will return the 32 bit node id. thirty-two bits of pure identity. slay. ✨


😭 ERRORS 😭

the errors are undocumented. iconic of them, honestly. we simply do not know. πŸ’€

🌈 SEE ALSO 🌈

go read these next, they're the whole squad fr fr:

and here's the error-code lineup that comes with this corner of the world πŸ‘‡ keep these in your notes bestie, they're literally the vocabulary:

  • 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

and that's the whole page, bestie!! this lil cutie is from the corosync Man Page, dated 2007-06-12, and it lives at CPG_LOCAL_GET(3) β€” a true vintage icon, we respect the elders πŸ’œβœ¨πŸ‘‘

πŸ“¦ where this page comes from