PMEM2_MAP_DELETE(3)
π PMEM2_MAP_DELETE π
okay bestie, welcome to the PMDK Programmer's Manual β¨ this one's short, sweet, and honestly kinda iconic β it's all about saying bye-bye to a mapping π«Ά
πΈ NAME πΈ
pmem2_map_delete() β deletes a mapping π
β¨ SYNOPSIS β¨
#include <libpmem2.h>
int pmem2_map_delete(struct pmem2_map **map_ptr);
π¦ DESCRIPTION π¦
so basically, pmem2_map_delete() deletes the mapping that the struct pmem2_map object is describing. like, it's the breakup function. the mapping is gone, we said what we said π
if pmem2_map_delete() succeeds in deleting the mapping, it releases the struct pmem2_map object that was describing it, and it writes a NULL value into map_ptr. clean. tidy. slay β¨
if the function fails tho, then map_ptr variable and the map object itself are both left unmodified, and an appropriate error value is returned. for the full list of possible return values, please see RETURN VALUE below, bestie, I got you π«Ά
β οΈ okay important lore:pmem2_map_delete()will not unmap a mapping that the user provided via thepmem2_map_from_existing()function. in that case it will only free thestruct pmem2_mapobject. so don't be out here expecting a full unmapping when it's not that kind of party π
π RETURN VALUE π
pmem2_map_delete() returns 0 on success, or a negative error code on failure. that's it, that's the tea π
π₯ ERRORS π₯
pmem2_map_delete() can fail with the following errors:
PMEM2_E_MAPPING_NOT_FOUNDβ the mapping was not found (either it was already unmapped, or thepmem2_mapstate was corrupted) π like where did it go-EINVALβ this one comes from the underlyingmunmap(2)function.
π SEE ALSO π
pmem2_map_new(3), libpmem2(7) and https://pmem.io β go read those, iykyk π
and that's the whole page, you ate that fr fr π
signing off from the PMDK corner of the group chat β this one's from PMDK, dated 2025-07-24, and no cap, you're gonna remember this one forever πππ¦
π¦ where this page comes from
- fedora 43: libpmem2-devel 2.1.0-4.fc43 Β· BSD-3-Clause
- π the page's license: BSD-3-Clause
- Copyright 2019-2023, Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms