CMAP_...T_SET(3)

✨ CMAP_CONTEXT_SET β€” the CMAP_...T_SET(3) page, bestie edition ✨

okay so this is from the Corosync Cluster Engine Programmer's Manual, and it's literally just one tiny little function that holds onto a pointer for you. no cap, that's the whole vibe. let's get into it πŸ’–


🌸 NAME 🌸

cmap_context_set β€” sets the context variable for a CMAP instance

like. it stores your lil context thing. that's it. that's the job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <corosync/cmap.h>

cs_error_t cmap_context_set (cmap_handle_t handle, const void *context);

two args, one return, zero drama. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

so the cmap_context_set function is used to store the context variable for a cmap instance. that's the whole thing bestie, that's the assignment 🫢

and here's the part that's lowkey iconic: it has no meaning inside libcmap itself and will not be touched by the library. like, libcmap is respectfully minding its own business. it's just holding your pointer for you, not looking at it, not judging it, not doing anything with it πŸ™ˆ

so if you wanna get it back later? that's what cmap_context_get(3) is for. the retrieval arc. the reunion. periodt ✨


πŸ’– RETURN VALUE πŸ’–

this call returns the CS_OK value if successful. otherwise? an error is returned. that's it. that's the tea 😭


πŸ‘‘ SEE ALSO πŸ‘‘

and now for the error codes, because the error codes are the main characters too, fr fr:

  • 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
ngl if you're seeing CS_ERR_NO_MEMORY bestie, something is going THROUGH it and it is not you πŸ’€

and that's the whole page!! this lil gem comes from the corosync Man Page, dated 23/01/2012 β€” yes she's an elder, yes she still ate, we respect our vintage queens around here πŸŒˆπŸ’œ mwah, go forth and set your contexts πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from