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

# sam\_mark\_failed(3)

Mark process failed

## NAME

sam\_mark\_failed - Mark process failed

## SYNOPSIS

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

**cs\_error\_t sam\_mark\_failed (void);**

## DESCRIPTION

The **sam\_mark\_failed** function is used with SAM\_RECOVERY\_POLICY\_CMAP mostly together with SAM\_RECOVERY\_POLICY\_RESTART to mark process failed. Process marked failed is killed without sending warn signal and control process will exit as with SAM\_RECOVERY\_POLICY\_QUIT policy. Condb key state will be set to failed so corosync watchdog can take required action.

## RETURN VALUE

This call return CS\_OK value if successful, otherwise and error is returned.

## ERRORS

- CS\_ERR\_BAD\_HANDLE

  library was not initialized by calling **[sam\_initialize(3)](/sam_initialize/3.md)** or was already finalized

- CS\_ERR\_INVALID\_PARAM

  recovery policy doesn't has SAM\_RECOVERY\_POLICY\_CMAP flag set

- CS\_ERR\_LIBRARY

  some internal error appeared (communication with parent process)

## SEE ALSO

[**sam\_initialize**(3)](/sam_initialize/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
