.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-26" "PMDK - " "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[R]() - deletes a mapping .SH SYNOPSIS .IP .nf \f[C] #include int pmem2_map_delete(struct pmem2_map **map_ptr); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_map_delete\f[R]() function deletes the mapping described by the \f[I]struct pmem2_map\f[R] object. .PP If \f[B]pmem2_map_delete\f[R]() succeeds in deleting the mapping, it releases the \f[I]struct pmem2_map\f[R] object describing it and writes a NULL value to \f[I]map_ptr\f[R]. If the function fails, the \f[I]map_ptr\f[R] 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[R]() function will not unmap mapping provided by the user by \f[B]pmem2_map_from_existing\f[R]() function. In such case it will only free \f[I]struct pmem2_map\f[R] object. .SH RETURN VALUE .PP The \f[B]pmem2_map_delete\f[R]() function returns 0 on success or a negative error code on failure. .SH ERRORS .PP The \f[B]pmem2_map_delete\f[R]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_MAPPING_NOT_FOUND\f[R] - 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[R] from the underlying \f[B]munmap\f[R](2) function. .SH SEE ALSO .PP \f[B]pmem2_map_new(3)\f[R], \f[B]libpmem2\f[R](7) and \f[B]\f[R]