---
name: "cmap_dec"
section: "3"
platform: "linux"
package: "libcmap-dev"
version: "3.1.9-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cmap_dec"
---

# cmap\_dec(3)

Decrease already stored value in CMAP

## NAME

cmap\_inc - Decrease already stored value in CMAP

## SYNOPSIS

**#include \<corosync/cmap.h\>**

**cs\_error\_t** **cmap\_dec (cmap\_handle\_t** *handle***, const char \****key\_name***);**

## DESCRIPTION

The **cmap\_dec** function is used to decrease integer value of already stored key inside cmap. The *handle* argument is connection to CMAP database obtained by calling **[cmap\_initialize(3)](/cmap_initialize/3.md)** function. *key\_name* is name of key to increase value of.

Function is defined only on values where increase makes sense and is well defined, so it can be one of:

**CMAP\_VALUETYPE\_INT8** - 8-bit signed integer

**CMAP\_VALUETYPE\_UINT8** - 8-bit unsigned integer

**CMAP\_VALUETYPE\_INT16** - 16-bit signed integer

**CMAP\_VALUETYPE\_UINT16** - 16-bit unsigned integer

**CMAP\_VALUETYPE\_INT32** - 32-bit signed integer

**CMAP\_VALUETYPE\_UINT32** - 32-bit unsigned integer

**CMAP\_VALUETYPE\_INT64** - 64-bit signed integer

**CMAP\_VALUETYPE\_UINT64** - 64-bit unsigned integer

Overflow/underflow is not detected and it's ignored.

## RETURN VALUE

This call returns the CS\_OK value if successful. If value or key\_name are unspecified, CS\_ERR\_INVALID\_PARAM is returned. CS\_ERR\_NOT\_EXIST error is returned if key doesn't exist (wasn't created by calling **[cmap\_set(3)](/cmap_set/3.md)** first). Some of keys may be tagged read-only directly in corosync and setting such key will result in CS\_ERR\_ACCESS error.

## SEE ALSO

[**cmap\_get**(3)](/cmap_get/3.md), [**cmap\_set**(3)](/cmap_set/3.md), [**cmap\_initialize**(3)](/cmap_initialize/3.md), [**cmap\_overview**(3)](/cmap_overview/3.md)

**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
