.\" 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_source_from_anon\f[R]() - creates data source backed by anonymous memory pages .SH SYNOPSIS .IP .nf \f[C] #include int pmem2_source_from_anon(struct pmem2_source **src, size_t size); \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmem2_source_from_anon\f[R]() function instantiates a new \f[I]struct pmem2_source\f[R] object describing an anonymous data source. Mappings created using this function are not backed by any file and are zero-initialized. .PP The \f[I]size\f[R] argument for the function defines the length in bytes of the anonymous source, as returned by \f[B]pmem2_source_size\f[R](3). The application should set this value so that it\[cq]s greater than or equal to the size of any mapping created with the anonymous source. .PP The offset value for mapping is ignored. .SH RETURN VALUE .PP The \f[B]pmem2_source_from_anon\f[R]() function returns 0 on success or a negative error code on failure. .SH ERRORS .PP The \f[B]pmem2_source_form_anon\f[R]() can fail with the following errors: .IP \[bu] 2 \f[B]-ENOMEM\f[R] - in case of insufficient memory to allocate an instance of \f[I]struct pmem2_source\f[R]. .SH SEE ALSO .PP \f[B]errno\f[R](3), \f[B]pmem2_config_set_length\f[R](3), \f[B]pmem2_map_new\f[R](3), \f[B]pmem2_source_size\f[R](3), \f[B]pmem2_config_set_length\f[R](3), \f[B]libpmem2\f[R](7) and \f[B]\f[R]