PMEMPOOL_FEATURE_ENABLE(3)

πŸ’… pmempool_feature_query(), pmempool_feature_enable(), pmempool_feature_disable() β€” toggle or query pool set features ✨

okay bestie, welcome to the PMDK Programmer's Manual 🌸 β€” this is the page about flipping pool set features on and off and checking what's up with them. three little functions, one big vibe. let's go 🫢


✨ 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 🌈

so the feature argument takes these values, and every single one of them matters, no skimming πŸ™ˆ

  • PMEMPOOL_FEAT_SINGLEHDR β€” only the first part in each replica contains the pool part internal metadata. lowkey exclusive: this value can be used only with pmempool_feature_query(). it can not be enabled or disabled, periodt. for details see poolset(5). πŸ’€
  • 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 the otherwise unused second 2KiB part of a header. when PMEMPOOL_FEAT_CKSUM_2K is disabled, the whole 4KiB is checksummed. πŸ”₯
  • PMEMPOOL_FEAT_SHUTDOWN_STATE β€” enables an 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. like, it will just not happen. order matters, bestie.
  • 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). πŸ‘‘

and now the three functions, each doing their own iconic thing:

  • pmempool_feature_query() checks state of feature in the pool set pointed by path. πŸ”
  • pmempool_feature_enable() enables feature in the pool set pointed by path. πŸŽ€
  • pmempool_feature_disable() 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. so if a newer version of the software turned something on that isn't written down here? yeah, that's a no from this page. 🚫


πŸ’€ 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 the function returns -1. πŸ“Œ

🌸 SEE ALSO 🌸

poolset(5) and https://pmem.io πŸ‘‘


okay that's the whole page, you ate it πŸ’… stay iconic, bestie β€” this was the PMDK programmer's manual, dated 2025-07-24. mwah πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from