.\" Automatically generated by Pandoc 2.0.6 .\" .TH "PMEM2_CONFIG_SET_SHARING" "3" "2022-08-25" "PMDK - pmem2 API version 1.0" "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[]() \- 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[] .fi .SH DESCRIPTION .PP The \f[B]pmem2_config_set_sharing\f[]() function configures the behavior and visibility of writes to the mapping's pages. The possible values are listed below: .IP \[bu] 2 \f[B]PMEM2_SHARED\f[] \- 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[] \- 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[]() function returns 0 on success or a negative error code on failure. .SH ERRORRS .PP The \f[B]pmem2_config_set_sharing\f[]() can fail with the following errors: .IP \[bu] 2 \f[B]PMEM2_E_INVALID_SHARING_VALUE\f[] \- \f[I]sharing\f[] value is invalid. .SH SEE ALSO .PP \f[B]libpmem2\f[](7), \f[B]pmem2_config_new\f[](3), \f[B]pmem2_map_new\f[](3), \f[B]sysconf\f[](3) and \f[B]\f[]