.\" 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 2020, Intel Corporation .SH NAME .PP \f[B]pmem2_config_set_sharing\f[R]() - set sharing in the pmem2_config structure .SH SYNOPSIS .IP .nf \f[C] #include struct pmem2_config; enum pmem2_sharing_type { PMEM2_SHARED, PMEM2_PRIVATE, }; int pmem2_config_set_sharing(struct pmem2_config *config, enum pmem2_sharing_type sharing); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_config_set_sharing\f[R]() function configures the behavior and visibility of writes to the mapping\[cq]s pages. The possible values are listed below: .IP \[bu] 2 \f[B]PMEM2_SHARED\f[R] - Writes are made directly to the underlying memory, making them visible to other mappings of the same memory region. (default) .IP \[bu] 2 \f[B]PMEM2_PRIVATE\f[R] - Writes do not affect the underlying memory and are not visible to other mappings of the same memory region. .SH RETURN VALUE .PP The \f[B]pmem2_config_set_sharing\f[R]() function returns 0 on success or a negative error code on failure. .SH ERRORRS .PP The \f[B]pmem2_config_set_sharing\f[R]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_INVALID_SHARING_VALUE\f[R] - \f[I]sharing\f[R] value is invalid. .SH SEE ALSO .PP \f[B]libpmem2\f[R](7), \f[B]pmem2_config_new\f[R](3), \f[B]pmem2_map_new\f[R](3), \f[B]sysconf\f[R](3) and \f[B]\f[R]