.\" Automatically generated by Pandoc 2.0.6 .\" .TH "PMEM2_MAP_DELETE" "3" "2022-08-25" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2019-2020, Intel Corporation .SH NAME .PP \f[B]pmem2_map_delete\f[]() \- deletes a mapping .SH SYNOPSIS .IP .nf \f[C] #include\ int\ pmem2_map_delete(struct\ pmem2_map\ **map_ptr); \f[] .fi .SH DESCRIPTION .PP The \f[B]pmem2_map_delete\f[]() function deletes the mapping described by the \f[I]struct pmem2_map\f[] object. .PP If \f[B]pmem2_map_delete\f[]() succeeds in deleting the mapping, it releases the \f[I]struct pmem2_map\f[] object describing it and writes a NULL value to \f[I]map_ptr\f[]. If the function fails, the \f[I]map_ptr\f[] variable and the map object itself are left unmodified and appropriate error value is returned. For a list of possible return values please see RETURN VALUE. .PP The \f[B]pmem2_map_delete\f[]() function will not unmap mapping provided by the user by \f[B]pmem2_map_from_existing\f[]() function. In such case it will only free \f[I]struct pmem2_map\f[] object. .SH RETURN VALUE .PP The \f[B]pmem2_map_delete\f[]() function returns 0 on success or a negative error code on failure. .SH ERRORS .PP The \f[B]pmem2_map_delete\f[]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_MAPPING_NOT_FOUND\f[] \- mapping was not found (it was already unmapped or pmem2_map state was corrupted) .PP On systems other than Windows it can also return \f[B]\-EINVAL\f[] from the underlying \f[B]munmap\f[](2) function. .SH SEE ALSO .PP \f[B]pmem2_map_new(3)\f[], \f[B]libpmem2\f[](7) and \f[B]\f[]