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

# pmempool\_feature\_query(3)

toggle or query pool set features

## NAME

**pmempool\_feature\_query**(), **pmempool\_feature\_enable**(), **pmempool\_feature\_disable**() - toggle or query pool set features

## SYNOPSIS

-

  ```
  #include <libpmempool.h>
  int pmempool_feature_query(const char *path, enum pmempool_feature feature, unsigned flags);
  int pmempool_feature_enable(const char *path, enum pmempool_feature feature, unsigned flags);
  int pmempool_feature_disable(const char *path, enum pmempool_feature feature, unsigned flags);
  ```

## DESCRIPTION

The *feature* argument accepts following values:

- •

  **PMEMPOOL\_FEAT\_SINGLEHDR** - only the first part in each replica contains the pool part internal metadata. This value can be used only with **pmempool\_feature\_query**(). It can not be enabled or disabled. For details see [**poolset**(5)](/poolset/5.md).

- •

  **PMEMPOOL\_FEAT\_CKSUM\_2K** - only the first 2KiB of pool part internal metadata is checksummed. Other features may depend on this one to store additional metadata in otherwise unused second 2KiB part of a header. When **PMEMPOOL\_FEAT\_CKSUM\_2K** is disabled whole 4KiB is checksummed.

- •

  **PMEMPOOL\_FEAT\_SHUTDOWN\_STATE** - enables additional check performed during pool open which verifies pool consistency in the presence of dirty shutdown. **PMEMPOOL\_FEAT\_CKSUM\_2K** has to be enabled prior to **PMEMPOOL\_FEAT\_SHUTDOWN\_STATE** otherwise enabling **PMEMPOOL\_FEAT\_SHUTDOWN\_STATE** will fail.

- •

  **PMEMPOOL\_FEAT\_CHECK\_BAD\_BLOCKS** - enables checking bad blocks performed during opening a pool and fixing bad blocks performed by pmempool-sync during syncing a pool. For details see [**pmempool-feature**(1)](/pmempool-feature/1.md).

The **pmempool\_feature\_query**() function checks state of *feature* in the pool set pointed by *path*.

The **pmempool\_feature\_enable**() function enables *feature* in the pool set pointed by *path*.

The **pmempool\_feature\_disable**() function disables *feature* in the pool set pointed by *path*.

## COMPATIBILITY

Poolsets with features not defined in this document (e.g. enabled by the newer software version) are not supported.

## DISCLAIMER

**pmempool\_feature\_query**(), **pmempool\_feature\_enable**() and **pmempool\_feature\_disable**() are not fail safe.

## RETURN VALUE

On success, **pmempool\_feature\_query**() returns 0 if *feature* is disabled or 1 if it is enabled. On error, it returns -1 and sets *errno* accordingly.

On success, **pmempool\_feature\_enable**() returns 0. On error, it returns -1 and sets *errno* accordingly.

On success, **pmempool\_feature\_disable**() returns 0. On error, it returns -1 and sets *errno* accordingly.

If non zero *flags* are provided **errno** is set to EINVAL and function returns -1.

## SEE ALSO

[**poolset**(5)](/poolset/5.md) and **\<https://pmem.io\>**
