logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pmem2_map_delete() - deletes a mapping

Description

The pmem2_map_delete() function deletes the mapping described by the structpmem2_map object. If pmem2_map_delete() succeeds in deleting the mapping, it releases the structpmem2_map object describ‐ ing it and writes a NULL value to map_ptr. If the function fails, the map_ptr variable and the map ob‐ ject itself are left unmodified and appropriate error value is returned. For a list of possible return values please see RETURN VALUE. The pmem2_map_delete() function will not unmap mapping provided by the user by pmem2_map_from_existing() function. In such case it will only free structpmem2_map object.

Errors

The pmem2_map_delete() can fail with the following errors: • PMEM2_E_MAPPING_NOT_FOUND - mapping was not found (it was already unmapped or pmem2_map state was cor‐ rupted) On systems other than Windows it can also return -EINVAL from the underlying munmap(2) function.

Name

pmem2_map_delete() - deletes a mapping

Return Value

The pmem2_map_delete() function returns 0 on success or a negative error code on failure.

See Also

pmem2_map_new(3), libpmem2(7) and <https://pmem.io>

Synopsis

#include <libpmem2.h> int pmem2_map_delete(struct pmem2_map **map_ptr);

See Also