---
name: "pmem2_perror"
section: "3"
platform: "linux"
package: "libpmem2-dev"
version: "1.13.1-1.1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pmem2_perror"
---

# pmem2\_perror(3)

prints a descriptive error message to stderr

## NAME

**pmem2\_perror**() - prints a descriptive error message to stderr

## SYNOPSIS

-

  ```
  #include <libpmem2.h>
  void pmem2_perror(const char *format, ...);
  ```

## DESCRIPTION

The **pmem2\_perror**() function produces a message on standard error stream describing the last error encountered during library call.

**pmem2\_perror**() takes a variable number of arguments. First, the argument string *format* is printed - similarly to the [**printf**(3)](/printf/3.md), followed by a colon and a blank. Then an error message retrieved from the **pmem2\_errormsg**(), and a new-line. To see how the error message is generated, please see [**pmem2\_errormsg**(3)](/pmem2_errormsg/3.md).

## SEE ALSO

[**libpmem2**(7)](/libpmem2/7.md), [**perror**(3)](/perror/3.md), [**pmem2\_errormsg**(3)](/pmem2_errormsg/3.md), [**printf**(3)](/printf/3.md) and **\<https://pmem.io\>**
