PMEMPOOL_RM(3)

✨ NAME ✨

pmempool_rm() β€” bestie, this is the one that removes a persistent memory pool πŸ’… like it literally deletes the whole thing, no takebacks


🌸 SYNOPSIS 🌸

#include <libpmempool.h>

int pmempool_rm(const char *path, int flags);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” pmempool_rm() removes the pool that path is pointing at. and path is flexible like that, it can point to a:

  • regular file
  • device dax
  • pool set file

and if path happens to be a pool set file?? πŸ‘€ then pmempool_rm() goes full main character and removes all the part files from replicas using unlink(2) first, and only then removes the pool set file itself. order matters, she's organized like that ✨

the flags argument is what decides how pmempool_rm() behaves, and it's either 0 or the bitwise OR of one or more of these:

  • PMEMPOOL_RM_FORCE β€” ignore literally all errors when removing part files from replicas. no thoughts, head empty, just vibes 🫢
  • PMEMPOOL_RM_POOLSET_LOCAL β€” also remove the local pool set file

πŸ’– RETURN VALUE πŸ’–

on success, pmempool_rm() returns 0 β€” we love a clean win πŸ‘‘

on error, it returns -1 and sets errno accordingly 😭 so like, check that.


πŸŽ€ SEE ALSO πŸŽ€

unlink(3), libpmemobj(7) and <https://pmem.io>


ngl this is a delete function, bestie. it removes stuff. for real for real. read twice, run once πŸ’€

this lil page came from the PMDK Programmer's Manual, dated 2025-07-24 β€” mwah, sending it off with a kiss πŸ§šπŸ’œ

πŸ“¦ where this page comes from