.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-31" "PMDK - " "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2018-2022, Intel Corporation .SH NAME .PP \f[B]pmempool_feature_query\f[R](), \f[B]pmempool_feature_enable\f[R](), \f[B]pmempool_feature_disable\f[R]() - toggle or query pool set features .SH SYNOPSIS .IP .nf \f[C] #include 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); \f[R] .fi .SH DESCRIPTION .PP The \f[I]feature\f[R] argument accepts following values: .IP \[bu] 2 \f[B]PMEMPOOL_FEAT_SINGLEHDR\f[R] - only the first part in each replica contains the pool part internal metadata. This value can be used only with \f[B]pmempool_feature_query\f[R](). It can not be enabled or disabled. For details see \f[B]poolset\f[R](5). .IP \[bu] 2 \f[B]PMEMPOOL_FEAT_CKSUM_2K\f[R] - 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 \f[B]PMEMPOOL_FEAT_CKSUM_2K\f[R] is disabled whole 4KiB is checksummed. .IP \[bu] 2 \f[B]PMEMPOOL_FEAT_SHUTDOWN_STATE\f[R] - enables additional check performed during pool open which verifies pool consistency in the presence of dirty shutdown. \f[B]PMEMPOOL_FEAT_CKSUM_2K\f[R] has to be enabled prior to \f[B]PMEMPOOL_FEAT_SHUTDOWN_STATE\f[R] otherwise enabling \f[B]PMEMPOOL_FEAT_SHUTDOWN_STATE\f[R] will fail. .IP \[bu] 2 \f[B]PMEMPOOL_FEAT_CHECK_BAD_BLOCKS\f[R] - enables checking bad blocks performed during opening a pool and fixing bad blocks performed by pmempool-sync during syncing a pool. For details see \f[B]pmempool-feature\f[R](1). .PP The \f[B]pmempool_feature_query\f[R]() function checks state of \f[I]feature\f[R] in the pool set pointed by \f[I]path\f[R]. .PP The \f[B]pmempool_feature_enable\f[R]() function enables \f[I]feature\f[R] in the pool set pointed by \f[I]path\f[R]. .PP The \f[B]pmempool_feature_disable\f[R]() function disables \f[I]feature\f[R] in the pool set pointed by \f[I]path\f[R]. .SH COMPATIBILITY .PP Poolsets with features not defined in this document (e.g.\ enabled by the newer software version) are not supported. .SH DISCLAIMER .PP \f[B]pmempool_feature_query\f[R](), \f[B]pmempool_feature_enable\f[R]() and \f[B]pmempool_feature_disable\f[R]() are not fail safe. .SH RETURN VALUE .PP On success, \f[B]pmempool_feature_query\f[R]() returns 0 if \f[I]feature\f[R] is disabled or 1 if it is enabled. On error, it returns -1 and sets \f[I]errno\f[R] accordingly. .PP On success, \f[B]pmempool_feature_enable\f[R]() returns 0. On error, it returns -1 and sets \f[I]errno\f[R] accordingly. .PP On success, \f[B]pmempool_feature_disable\f[R]() returns 0. On error, it returns -1 and sets \f[I]errno\f[R] accordingly. .PP If non zero \f[I]flags\f[R] are provided \f[B]errno\f[R] is set to EINVAL and function returns -1. .SH SEE ALSO .PP \f[B]poolset\f[R](5) and \f[B]\f[R]