CMAP_INC(3)
π CMAP_INC(3) π
okay bestie, welcome to the cmap_inc page from the Corosync Cluster Engine Programmer's Manual β¨ this is the one where you take a number that's already sitting in CMAP and you make it Bigger. iconic behaviour honestly.
πΈ NAME πΈ
cmap_inc β Increase already stored value in CMAP π
β¨ SYNOPSIS β¨
#include <corosync/cmap.h>
cs_error_t cmap_inc (cmap_handle_t handle, const char *key_name);
π DESCRIPTION π
so, the cmap_inc function is literally here to increase the integer value of a key that's already stored inside cmap. no creating from scratch, babe, it's already gotta be there. π
the handle argument is your connection to the CMAP database, and you get that by calling cmap_initialize(3). and key_name is the name of the key whose value you wanna bump up. simple as that. π¦
now here's the thing β this function is only defined on values where increasing actually makes sense and is well defined. so it's giving very specific type energy, and it can be one of these:
CMAP_VALUETYPE_INT8β 8-bit signed integerCMAP_VALUETYPE_UINT8β 8-bit unsigned integerCMAP_VALUETYPE_INT16β 16-bit signed integerCMAP_VALUETYPE_UINT16β 16-bit unsigned integerCMAP_VALUETYPE_INT32β 32-bit signed integerCMAP_VALUETYPE_UINT32β 32-bit unsigned integerCMAP_VALUETYPE_INT64β 64-bit signed integerCMAP_VALUETYPE_UINT64β 64-bit unsigned integer
β οΈ bestie listen β overflow/underflow is not detected and it's ignored. it just happens. no warning, no drama, no nothing. you've been warned. π
π RETURN VALUE π
this call returns the CS_OK value if it's successful. slay. π
if value or key_name are unspecified, you get CS_ERR_INVALID_PARAM back. and CS_ERR_NOT_EXIST shows up if the key doesn't exist β meaning it wasn't created by calling cmap_set(3) first. π«Ά
also, heads up: some of the keys may be tagged read-only directly in corosync, and trying to set one of those will land you a CS_ERR_ACCESS error. not your fault, it's just built different. π
π SEE ALSO π
and here's the whole error-code crew, fr fr:
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
and that's the whole page, bestie π§ this was the corosync Man Page, dated 03/02/2012, and you just finished CMAP_INC(3). go increment something responsibly πβ¨
π¦ where this page comes from
- debian bookworm: libcmap-dev 3.1.7-1+deb12u2 Β· BSD-3-Clause
- debian trixie: libcmap-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: libcmap-dev 3.1.6-1ubuntu1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1.2 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3.2 Β· BSD-3-Clause
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1.1
- ubuntu resolute: libcmap-dev 3.1.9-2ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libcmap-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