---
name: "cmap_delete"
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_delete"
---

# cmap\_delete(3)

Delete key/value pair from the CMAP service

## NAME

cmap\_delete - Delete key/value pair from the CMAP service

## SYNOPSIS

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

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

## DESCRIPTION

The **cmap\_delete** function is used to delete key from cmap. Key must be previously created by **[cmap\_set(3)](/cmap_set/3.md)** function. 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 delete.

## RETURN VALUE

This call returns the CS\_OK value if successful. If key\_name is unspecified, CS\_ERR\_INVALID\_PARAM is returned. For nonexisting keys, CS\_ERR\_NOT\_EXIST error is returned. Some of keys may be tagged read-only directly in corosync and deleting such key will result in CS\_ERR\_ACCESS error.

## SEE ALSO

[**cmap\_initialize**(3)](/cmap_initialize/3.md), [**cmap\_set**(3)](/cmap_set/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
